ADDED configf-testing/Makefile Index: configf-testing/Makefile ================================================================== --- /dev/null +++ configf-testing/Makefile @@ -0,0 +1,11 @@ + +all : c + +%.o : %.scm + csc -J -c $< -o $*.o + +c.o : a.o + +c : c.o a.o + csc a.o c.o -o c + ADDED configf-testing/a.scm Index: configf-testing/a.scm ================================================================== --- /dev/null +++ configf-testing/a.scm @@ -0,0 +1,22 @@ +(declare (unit a)) + +(module a + * + + (import scheme chicken posix) + + (define (a:normalize-dir d) + (if (and (file-exists? d) + (directory? d)) + (let ((curr (current-directory))) + (change-directory d) + (let ((nd (current-directory))) + (change-directory curr) + nd)) + d)) + + ) + + + + ADDED configf-testing/c.scm Index: configf-testing/c.scm ================================================================== --- /dev/null +++ configf-testing/c.scm @@ -0,0 +1,52 @@ +(declare (uses a)) + +;; pretend to be a config file processor +(use posix srfi-69) + +;; (define getenv get-environment-variable) +(define (print-hash-table ht) + (print "ht=") + (pp (hash-table->alist ht))) + +(define cfgdata (conc "(use simple-md5)" + "(import a)" + "(set! getenv get-environment-variable)" + "(hash-table-set! ht \"PATH\" (getenv \"PATH\"))" + "(hash-table-set! ht \"currdir\" (current-directory))" + "(hash-table-set! ht \"md5sum\" (string->md5sum \"Hello\"))" + ;; in mtconfigf the below is not working + "(hash-table-set! ht \"var-tmp\" (a:normalize-dir \"/var/tmp\"))")) + +(define (faux-cfg-processor ht cfgdata) + (let* ((proc-str (conc "(lambda (ht)" cfgdata ")"))) + (with-input-from-string proc-str + (lambda () + ((eval (read)) ht))))) + +(module cfgprocessor + * + +(import ports data-structures chicken scheme files srfi-69 posix srfi-1) + +(define (faux-cfg-processor-modularized ht cfgdata) + (let* ((proc-str (conc "(lambda (ht)" cfgdata ")"))) + (with-input-from-string proc-str + (lambda () + ((eval (read)) ht))))) +) + +(import cfgprocessor) +(import a) + +(print "\nCan I run stuff from module \"a\":") +(print (a:normalize-dir "/var/tmp")) + +(print "\nRun the non-modularized version") +(let ((ht (make-hash-table))) + (faux-cfg-processor ht cfgdata) + (print-hash-table ht)) + +(print "\nRun the modularized version") +(let ((ht (make-hash-table))) + (faux-cfg-processor-modularized ht cfgdata) + (print-hash-table ht)) ADDED utils/make-all-tar.sh Index: utils/make-all-tar.sh ================================================================== --- /dev/null +++ utils/make-all-tar.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# fossil timeline -n 0 -F %t|sort -u|grep -P '^v\d.\d\d\d\d$' + +ALLVERS=$(fossil timeline -n 0 -F %t|sed -e 's/, /\n/'|sort -u|grep -P '^v\d.[67890]\d\d\d$') + +PUBLISHVERS="\ + v1.6592 \ + v1.7016 \ + v1.7105 \ + v1.8032 \ + v1.8104 \ + v2.0001" + +for x in $PUBLISHVERS;do + ./utils/tarver.sh $x +done ADDED utils/tarver.sh Index: utils/tarver.sh ================================================================== --- /dev/null +++ utils/tarver.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +VERSION=$1 + +if [[ -z $VERSION ]];then + echo "Usage: tarver.sh [version]" + exit 1 +fi + +dbf=$(fossil info|grep repository:|awk '{print $2}') + +mkdir -p /tmp/$USER/mtbuild + +pushd /tmp/$USER/mtbuild + +if [[ -e $VERSION ]];then + echo "Cleaning out old /tmp copy of Megatest $VERSION" + rm -rf /tmp/$USER/mtbuild/$VERSION +fi + +mkdir -p /tmp/$USER/mtbuild/$VERSION +cd /tmp/$USER/mtbuild/$VERSION + +fossil open $dbf $VERSION + +make megatest-fossil-hash.scm + +cp .fslckout ../.fslckout-$VERSION +rm .fslckout +cd .. + +tar cfvz megatest-$VERSION.tar.gz $VERSION +popd + +cp /tmp/$USER/mtbuild/megatest-$VERSION.tar.gz . +fossil uv add megatest-$VERSION.tar.gz +rm megatest-$VERSION.tar.gz +