Overview
Comment: | Added nice min-path (on by default for envdelta to ini mode) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.61 |
Files: | files | file ages | folders |
SHA1: |
ccb0a505a6eb5f4be58dea985deadca4 |
User & Date: | matt on 2016-08-14 01:18:29 |
Other Links: | branch diff | manifest | tags |
Context
2016-08-14
| ||
15:13 | More runs.scm refactoring check-in: bb06286ccb user: matt tags: v1.61 | |
01:18 | Added nice min-path (on by default for envdelta to ini mode) check-in: ccb0a505a6 user: matt tags: v1.61 | |
2016-08-12
| ||
11:51 | Merged fork check-in: 6adb002803 user: mrwellan tags: v1.61 | |
Changes
Modified env.scm from [a5d18c5499] to [88e7c2b715].
︙ | ︙ | |||
148 149 150 151 152 153 154 | (if (hash-table? indat) (let ((dat (hash-table->alist indat))) (if (null? dat) #f dat)) #f)) | > > > > > > > > > > > > > > > > > > > > | | 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | (if (hash-table? indat) (let ((dat (hash-table->alist indat))) (if (null? dat) #f dat)) #f)) (define (env:inc-path path) (print "PATH " (conc "#{scheme (env:min-path \"" path "\" \"#{getenv PATH}\")}"))) ;; (conc ;; "#{scheme (string-intersperse " ;; "(delete-duplicates " ;; "(append (string-split \"" path "\" \":\") " ;; "(string-split \"#{getenv PATH}\" \":\")))" ;; " \":\")}"))) (define (env:min-path path1 path2) (string-intersperse (delete-duplicates (append (string-split path1 ":") (string-split path2 ":"))) ":")) ;; inc path will set a PATH that is incrementally modified when read - config mode only ;; (define (env:print added removed changed #!key (inc-path #t)) (let ((a (env:lazy-hash-table->alist added)) (r (env:lazy-hash-table->alist removed)) (c (env:lazy-hash-table->alist changed))) (case (if (args:get-arg "-dumpmode") (string->symbol (args:get-arg "-dumpmode")) 'bash) ((bash) |
︙ | ︙ | |||
191 192 193 194 195 196 197 | (print "# Changed vars") (map (lambda (dat)(print "setenv " (car dat) " " (cdr dat))) (hash-table->alist changed))))) ((config ini) (if a (begin (print "# Added vars") | | > > > > > > | > > > > > > | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | (print "# Changed vars") (map (lambda (dat)(print "setenv " (car dat) " " (cdr dat))) (hash-table->alist changed))))) ((config ini) (if a (begin (print "# Added vars") (map (lambda (dat) (let ((var (car dat)) (val (cdr dat))) (if (and inc-path (equal? var "PATH")) (env:inc-path val) (print var " " val)))) (hash-table->alist added)))) (if r (begin (print "# Removed vars") (map (lambda (dat)(print "#{scheme (unsetenv \"" (car dat) "\")}")) (hash-table->alist removed)))) (if c (begin (print "# Changed vars") (map (lambda (dat) (let ((var (car dat)) (val (cdr dat))) (if (and inc-path (equal? var "PATH")) (env:inc-path val) (print var " " val)))) (hash-table->alist changed))))) (else (debug:print-error 0 *default-log-port* "No dumpmode specified, use -dumpmode [bash|csh|config]"))))) |