Random Bits of Open Code

Check-in [74dfe92eac]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:updated method to set repository path to enable build-private egg installs
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:74dfe92eacf2691f67b66b922c6fa3ab76fa9701
User & Date: bjbarcla 2018-12-18 20:10:57
Context
2018-12-19
01:12
added "add-eval-string" to mtconfigf, which allows mtconfig consumer to add things like "(use my-module)" to import apis to #{scheme ..} and the like check-in: c358d9e639 user: bjbarcla tags: trunk
2018-12-18
20:10
updated method to set repository path to enable build-private egg installs check-in: 74dfe92eac user: bjbarcla tags: trunk
2018-12-17
23:35
Partial implementation of mtconfigf use in eval check-in: 0d9502e738 user: mrwellan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

a3d/testbox/a3d.scm became a regular file.

Changes to mtutils/mtconfigf/mtconfigf.scm.

323
324
325
326
327
328
329
330




331
332
333
334
335
336
337
...
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
		     (cmd     (list-ref matchdat 3))
		     (poststr (list-ref matchdat 4))
		     (result  #f)
		     (start-time (current-seconds))
		     (cmdsym  (string->symbol cmdtype))
		     (libpath (conc *common:this-exe-dir* "/../../eggs/lib/chicken/7"))
		     (allsnip (conc "(define getenv get-environment-variable)"
				    "(load-library mtconfigf \"" libpath "/mtconfigf.so\")"




				    ;;                ../../eggs/lib/chicken/7/mtconfigf.so
				    "(import mtconfigf)")) ;; (import mtconfigf)")
		     (fullcmd (case cmdsym
				((scheme scm) (conc "(lambda (ht)" allsnip "" cmd ")"))
				((system)     (conc "(lambda (ht)" allsnip "(configf:system ht \"" cmd "\"))"))
				((shell sh)   (conc "(lambda (ht)" allsnip "(string-translate (shell \""  cmd "\") \"\n\" \" \"))"))
				((realpath rp)(conc "(lambda (ht)" allsnip "(nice-path \"" cmd "\"))"))
................................................................................
				       ""))
		      ;; (debug:print 0 *default-log-port* "exn=" (condition->list exn))
		      (set! result (conc "#{( " cmdtype ") " cmd "}, full expansion: " fullcmd)))
		  (if (or allow-system
			  (not (member cmdtype '("system" "shell" "sh"))))
		      (with-input-from-string fullcmd
			(lambda ()
			  (set! result ((eval (read)(module-environment 'mtconfigf)) ht))))
		      (set! result (conc "#{(" cmdtype ") "  cmd "}"))))
		(case cmdsym
		  ((system shell scheme scm sh)
		   (let ((delta (- (current-seconds) start-time)))
		     (if (> delta 2)
			 (debug:print-info 0 *default-log-port* "for line \"" l "\"\n command:  " cmd " took " delta " seconds to run with output:\n   " result)
			 (debug:print-info 9 *default-log-port* "for line \"" l "\"\n command:  " cmd " took " delta " seconds to run with output:\n   " result)))))







|
>
>
>
>







 







|







323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
...
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
		     (cmd     (list-ref matchdat 3))
		     (poststr (list-ref matchdat 4))
		     (result  #f)
		     (start-time (current-seconds))
		     (cmdsym  (string->symbol cmdtype))
		     (libpath (conc *common:this-exe-dir* "/../../eggs/lib/chicken/7"))
		     (allsnip (conc "(define getenv get-environment-variable)"
                                    (if (and (not (get-environment-variable "CHICKEN_REPOSITORY"))
                                             (directory-exists? libpath))
                                        (conc "(repository-path \""libpath"\") ")
                                        "")
                                    "(use mtconfigf)"
				    ;;                ../../eggs/lib/chicken/7/mtconfigf.so
				    "(import mtconfigf)")) ;; (import mtconfigf)")
		     (fullcmd (case cmdsym
				((scheme scm) (conc "(lambda (ht)" allsnip "" cmd ")"))
				((system)     (conc "(lambda (ht)" allsnip "(configf:system ht \"" cmd "\"))"))
				((shell sh)   (conc "(lambda (ht)" allsnip "(string-translate (shell \""  cmd "\") \"\n\" \" \"))"))
				((realpath rp)(conc "(lambda (ht)" allsnip "(nice-path \"" cmd "\"))"))
................................................................................
				       ""))
		      ;; (debug:print 0 *default-log-port* "exn=" (condition->list exn))
		      (set! result (conc "#{( " cmdtype ") " cmd "}, full expansion: " fullcmd)))
		  (if (or allow-system
			  (not (member cmdtype '("system" "shell" "sh"))))
		      (with-input-from-string fullcmd
			(lambda ()
			  (set! result ((eval (read)#;(module-environment 'mtconfigf)) ht))))
		      (set! result (conc "#{(" cmdtype ") "  cmd "}"))))
		(case cmdsym
		  ((system shell scheme scm sh)
		   (let ((delta (- (current-seconds) start-time)))
		     (if (> delta 2)
			 (debug:print-info 0 *default-log-port* "for line \"" l "\"\n command:  " cmd " took " delta " seconds to run with output:\n   " result)
			 (debug:print-info 9 *default-log-port* "for line \"" l "\"\n command:  " cmd " took " delta " seconds to run with output:\n   " result)))))