commit d3f0994
chld
·
2026-09-12 14:09:42 +0000 UTC
parent 143ea8c
determine filetype in lock, print manifests
M
main.scm
+3,
-0
1@@ -62,6 +62,9 @@
2 ((#\d)
3 (del-pkg pkg)
4 )
5+ ((#\m)
6+ (pm-pkg pkg)
7+ )
8 )
9
10 (pargs (+ n 1))
M
pkg.scm
+31,
-5
1@@ -50,15 +50,41 @@
2 (define (del-pkg pkg)
3 (pmsg pkg "beginning removal")
4
5- (let (
6- (pl (format #f "~a/~a/lock" DULL_DB pkg))
7- )
8- (unless (file-exists? pl)
9- (die (format #f "package ~a~a~a does not have a lock file (not installed?)" "\x1b[33m" pkg "\x1b[0m") 2)
10+ (let* (
11+ (pl (format #f "~a/~a/lock" DULL_DB pkg))
12+ (pf (call-with-input-file pl
13+ (lambda (f)
14+ (string-split (read-string f) #\newline)
15+ )
16+ )
17+ )
18+ )
19+ (unless (file-exists? pl) (die (format #f "package ~a~a~a does not have a lock file (not installed?)" "\x1b[33m" pkg "\x1b[0m") 2))
20+
21+ (let fp (
22+ (n 0)
23+ )
24+ (unless (= n (length pf))
25+ ;; (display (list-ref pf n))(newline)
26+ (when (eq?
27+ (stat:type (stat (list-ref pf n))) 'regular
28+ )
29+ (format #t "~a file~%" (list-ref pf n))
30+ )
31+ (fp (+ n 1))
32+ )
33 )
34 )
35 )
36
37+(define (pm-pkg pkg)
38+ (format #t "~a"
39+ (call-with-input-file (format #f "~a/~a/lock" DULL_DB pkg)
40+ (lambda (f) (read-string f))
41+ )
42+ )
43+ )
44+
45 (define (build-pkg pkg)
46 (pmsg pkg "beginning build")
47 (system*