Megatest

Check-in [e22603e687]
Login
Overview
Comment:Added beginnings of multi-level glob
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.65
Files: files | file ages | folders
SHA1: e22603e687c8a3c0e025a432e8082431420c3d66
User & Date: matt on 2019-11-21 03:22:04
Other Links: branch diff | manifest | tags
Context
2019-11-21
09:25
Improved multi-glob check-in: c8e58c2956 user: mrwellan tags: v1.65
03:22
Added beginnings of multi-level glob check-in: e22603e687 user: matt tags: v1.65
2019-11-19
12:40
When suppressing variables at execute time be sure to actually unset them in the current environment. WARNING: This may be a wrong-headed strategy. Does suppressing vars mean megatest should not clobber or override or does it mean that it should unset? check-in: 2454028ce7 user: mrwellan tags: v1.65
Changes

Added multi-glob.scm version [86fb1e2447].























1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
(define (multi-glob pathspec)
  (let* ((path-parts (string-split pathspec "/" #t)))
    (if (null? path-parts)
	'()
	(let loop ((parts  (cdr path-parts))
		   (result (let ((p (car path-parts)))
			     (if (string=? p "")
				 '("/")
				 (glob (car path-parts))))))
	  (if (null? parts)
	      result
	      (let* ((part (car parts))
		     (rem  (cdr parts)))
		(loop rem
		      (apply append
			     (map (lambda (curr)
				    (let ((new (string-append curr "/" part)))
				      (if (and (directory? curr)
					       (file-read-access? curr))
					  (glob new)
					  '())))
				  result)))))))))