commit c82402b

chld  ·  2026-09-13 13:22:51 +0000 UTC
parent f49182b
determine versions more reliably
1 files changed,  +5, -7
+5, -7
 1@@ -35,16 +35,14 @@
 2 (define (ver-pkg pkg)
 3   (let i (
 4 	  (e
 5-	   (call-with-input-file (format #f "~a/info" (find-pkg pkg))
 6-	     (lambda (f) (read-string f))
 7+	   (call-with-input-file (format #f "~a/ndmake.sh" (find-pkg pkg))
 8+	     (lambda (f) (string-split (read-string f) #\newline))
 9 	     )
10 	   ))
11 
12-    ;; should really change info assumptions
13-    
14-    ;; version is conventionally on line 4
15-    ;; version: l.o.l, split by colon
16-    (string-trim (cadr (string-split (list-ref (string-split e #\newline) 4) #\:)))
17+    ;;(string-trim (cadr (string-split (caddr (string-split e #\newline)) #\=)))
18+    (string-trim (cadr (string-split
19+			(list-ref e (list-index (lambda (s) (string-contains s "VERSION")) e)) #\=)))
20     )
21   )
22