Index: archive.scm
==================================================================
--- archive.scm
+++ archive.scm
@@ -16,17 +16,21 @@
;; along with Megatest. If not, see .
;;
;; strftime('%m/%d/%Y %H:%M:%S','now','localtime')
-(use (prefix sqlite3 sqlite3:) srfi-1 posix regex regex-case srfi-69 format md5 message-digest srfi-18)
-
(declare (unit archive))
(declare (uses db))
+(declare (uses mtargs))
(declare (uses common))
(declare (uses commonmod))
-(import commonmod)
+
+(use (prefix sqlite3 sqlite3:) srfi-1 posix regex regex-case srfi-69
+ format md5 message-digest srfi-18)
+
+(import commonmod
+ (prefix mtargs args:))
(include "common_records.scm")
(include "db_records.scm")
;;======================================================================
Index: common.scm
==================================================================
--- common.scm
+++ common.scm
@@ -29,11 +29,14 @@
(use posix-extras pathname-expand files)
(declare (unit common))
(declare (uses commonmod))
-(import commonmod)
+(declare (uses mtargs))
+
+(import commonmod
+ (prefix mtargs args:))
(include "common_records.scm")
;; (require-library margs)
Index: configf.scm
==================================================================
--- configf.scm
+++ configf.scm
@@ -25,13 +25,15 @@
(use regex regex-case matchable) ;; directory-utils)
(declare (unit configf))
(declare (uses process))
(declare (uses env))
(declare (uses keys))
+(declare (uses mtargs))
(declare (uses commonmod))
(declare (uses commonmod.import))
-(import commonmod)
+(import commonmod
+ (prefix mtargs args:))
(include "common_records.scm")
;; return list (path fullpath configname)
(define (find-config configname #!key (toppath #f))
@@ -101,11 +103,11 @@
(define (configf:system ht cmd)
(system cmd)
)
-(define configf:imports "(import commonmod)")
+(define configf:imports "(import commonmod (prefix mtargs args:))")
(define (configf:process-line l ht allow-system #!key (linenum #f))
(let loop ((res l))
(if (string? res)
(let ((matchdat (string-search configf:var-expand-regex res)))
Index: dashboard.scm
==================================================================
--- dashboard.scm
+++ dashboard.scm
@@ -16,24 +16,12 @@
;; You should have received a copy of the GNU General Public License
;; along with Megatest. If not, see .
;;
;;======================================================================
-(use format)
-
-(require-library iup)
-(import (prefix iup iup:))
-
-(use canvas-draw)
-(import canvas-draw-iup)
-(use ducttape-lib)
-(use sqlite3 srfi-1 posix regex regex-case srfi-69 typed-records sparse-vectors) ;; defstruct
-(import (prefix sqlite3 sqlite3:))
-(import dbfile)
-
(declare (uses common))
-(declare (uses margs))
+(declare (uses mtargs))
(declare (uses keys))
(declare (uses items))
(declare (uses db))
(declare (uses configf))
(declare (uses process))
@@ -49,13 +37,27 @@
(declare (uses dbmod))
;; (declare (uses dbmemmod))
(declare (uses dbfile))
(declare (uses commonmod))
(declare (uses commonmod.import))
-(import commonmod)
-(import dbmod dbfile)
+(use format)
+
+(require-library iup)
+(import (prefix iup iup:))
+
+(use canvas-draw)
+(import canvas-draw-iup
+ (prefix sqlite3 sqlite3:))
+
+(use ducttape-lib)
+(use sqlite3 srfi-1 posix regex regex-case srfi-69 typed-records sparse-vectors) ;; defstruct
+
+(import commonmod
+ (prefix mtargs args:)
+ dbmod
+ dbfile)
(include "common_records.scm")
(include "db_records.scm")
(include "run_records.scm")
(include "task_records.scm")
Index: db.scm
==================================================================
--- db.scm
+++ db.scm
@@ -32,11 +32,13 @@
(declare (uses keys))
(declare (uses ods))
(declare (uses client))
(declare (uses mt))
(declare (uses commonmod))
-(import commonmod)
+(declare (uses mtargs))
+(import commonmod
+ (prefix mtargs args:))
(use (srfi 18)
extras
tcp
stack
Index: env.scm
==================================================================
--- env.scm
+++ env.scm
@@ -18,10 +18,14 @@
;;======================================================================
(declare (unit env))
+(declare (uses mtargs))
+
+(import (prefix mtargs args:))
+
(use sql-de-lite) ;; srfi-1 posix regex regex-case srfi-69 srfi-18 call-with-environment-variables)
(define (env:open-db fname)
(let* ((db-exists (common:file-exists? fname))
(db (open-database fname)))
Index: ezsteps.scm
==================================================================
--- ezsteps.scm
+++ ezsteps.scm
@@ -17,22 +17,25 @@
;; along with Megatest. If not, see .
;;
;; strftime('%m/%d/%Y %H:%M:%S','now','localtime')
-(use srfi-1 posix regex srfi-69 directory-utils call-with-environment-variables posix-extras
- z3 csv typed-records pathname-expand matchable)
-
(declare (unit ezsteps))
(declare (uses db))
(declare (uses common))
(declare (uses items))
(declare (uses runconfig))
;; (declare (uses sdb))
;; (declare (uses filedb))
(declare (uses commonmod))
-(import commonmod)
+(declare (uses mtargs))
+
+(use srfi-1 posix regex srfi-69 directory-utils call-with-environment-variables posix-extras
+ z3 csv typed-records pathname-expand matchable)
+
+(import commonmod
+ (prefix mtargs args:))
(include "common_records.scm")
(include "key_records.scm")
(include "db_records.scm")
(include "run_records.scm")
Index: http-transport.scm
==================================================================
--- http-transport.scm
+++ http-transport.scm
@@ -14,21 +14,10 @@
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Megatest. If not, see .
-(require-extension (srfi 18) extras tcp s11n)
-
-
-(use srfi-1 posix regex regex-case srfi-69 hostinfo md5 message-digest posix-extras)
-
-(use spiffy uri-common intarweb http-client spiffy-request-vars intarweb spiffy-directory-listing)
-
-;; Configurations for server
-(tcp-buffer-size 2048)
-(max-connections 2048)
-
(declare (unit http-transport))
(declare (uses common))
(declare (uses db))
(declare (uses tests))
@@ -37,10 +26,23 @@
;; (declare (uses daemon))
(declare (uses portlogger))
(declare (uses rmt))
(declare (uses dbfile))
(declare (uses commonmod))
+(declare (uses mtargs))
+
+(require-extension (srfi 18) extras tcp s11n)
+
+(use srfi-1 posix regex regex-case srfi-69 hostinfo md5 message-digest posix-extras)
+
+(use spiffy uri-common intarweb http-client spiffy-request-vars intarweb spiffy-directory-listing)
+
+(import (prefix mtargs args:))
+
+;; Configurations for server
+(tcp-buffer-size 2048)
+(max-connections 2048)
(include "common_records.scm")
(include "db_records.scm")
(include "js-path.scm")
Index: launch.scm
==================================================================
--- launch.scm
+++ launch.scm
@@ -19,25 +19,27 @@
;;======================================================================
;; launch a task - this runs on the originating host, tests themselves
;;
;;======================================================================
-(use regex regex-case base64 sqlite3 srfi-18 directory-utils posix-extras z3
- call-with-environment-variables csv)
-(use typed-records pathname-expand matchable)
-
-(import (prefix base64 base64:))
-(import (prefix sqlite3 sqlite3:))
-
(declare (unit launch))
(declare (uses subrun))
(declare (uses common))
(declare (uses commonmod))
(declare (uses configf))
(declare (uses db))
(declare (uses ezsteps))
(declare (uses dbfile))
+(declare (uses mtargs))
+
+(use regex regex-case base64 sqlite3 srfi-18 directory-utils posix-extras z3
+ call-with-environment-variables csv)
+(use typed-records pathname-expand matchable)
+
+(import (prefix base64 base64:)
+ (prefix sqlite3 sqlite3:)
+ (prefix mtargs args:))
(include "common_records.scm")
(include "key_records.scm")
(include "db_records.scm")
(include "megatest-fossil-hash.scm")
Index: margs.scm
==================================================================
--- margs.scm
+++ margs.scm
@@ -34,14 +34,10 @@
val
(if (null? default)
#f
default))))
-(define (args:any? . args)
- (not (null? (filter (lambda (x) x)
- (map args:get-arg args)))))
-
(define (args:get-arg-from ht arg . default)
(if (null? default)
(hash-table-ref/default ht arg #f)
(hash-table-ref/default ht arg (car default))))
@@ -56,18 +52,22 @@
(if (string? help)
(print help)
(print "Usage: " (car (argv)) " ... "))
(exit 0))
- ;; one-of args defined
-(define (args:any-defined? . param)
- (let ((res #f))
- (for-each
- (lambda (arg)
- (if (args:get-arg arg)(set! res #t)))
- param)
- res))
+(define (args:any-defined? . args)
+ (not (null? (filter (lambda (x) x)
+ (map args:get-arg args)))))
+
+;; ;; one-of args defined
+;; (define (args:any-defined? . param)
+;; (let ((res #f))
+;; (for-each
+;; (lambda (arg)
+;; (if (args:get-arg arg)(set! res #t)))
+;; param)
+;; res))
;; args:
(define (args:get-args args params switches arg-hash num-needed)
(let* ((numargs (length args))
(adj-num-needed (if num-needed (+ num-needed 2) #f)))
Index: megatest.scm
==================================================================
--- megatest.scm
+++ megatest.scm
@@ -22,13 +22,13 @@
;; fake out readline usage of toplevel-command
(define (toplevel-command . a) #f)
(declare (uses common))
;; (declare (uses megatest-version))
-(declare (uses margs))
-(declare (uses mtargs))
-(declare (uses mtargs.import))
+;; (declare (uses margs))
+;; (declare (uses mtargs))
+;; (declare (uses mtargs.import))
(declare (uses commonmod))
(declare (uses commonmod.import))
(declare (uses mtargs))
(declare (uses mtargs.import))
(declare (uses debugprint))
@@ -64,11 +64,11 @@
;; (declare (uses debugprint.import))
;; (declare (uses ftail))
;; (import ftail)
-(import mtargs
+(import (prefix mtargs args:)
debugprint
dbmod
commonmod
dbfile
tcp-transportmod
@@ -678,11 +678,11 @@
(process:children #f))
(original-exit exit-code)))))
;; for some switches always print the command to stderr
;;
-(if (args:any? "-run" "-runall" "-remove-runs" "-set-state-status" "-kill-runs" "-kill-rerun")
+(if (args:any-defined? "-run" "-runall" "-remove-runs" "-set-state-status" "-kill-runs" "-kill-rerun")
(debug:print 0 *default-log-port* (string-intersperse (argv) " ")))
;;======================================================================
;; Misc setup stuff
Index: mtargs/mtargs.scm
==================================================================
--- mtargs/mtargs.scm
+++ mtargs/mtargs.scm
@@ -98,7 +98,11 @@
(define (print-args arg-hash)
(for-each (lambda (arg)
(print " " arg " " (hash-table-ref/default arg-hash arg #f)))
(hash-table-keys arg-hash)))
+(define (any-defined? . args)
+ (not (null? (filter (lambda (x) x)
+ (map get-arg args)))))
+
)
Index: tree.scm
==================================================================
--- tree.scm
+++ tree.scm
@@ -16,27 +16,29 @@
;; You should have received a copy of the GNU General Public License
;; along with Megatest. If not, see .
;;
;;======================================================================
+(declare (unit tree))
+(declare (uses mtargs))
+(declare (uses launch))
+;; (declare (uses megatest-version))
+(declare (uses gutils))
+(declare (uses db))
+(declare (uses server))
+;; (declare (uses synchash))
+(declare (uses dcommon))
+
(use format)
(require-library iup)
(import (prefix iup iup:))
(use canvas-draw)
(use sqlite3 srfi-1 posix regex regex-case srfi-69)
(import (prefix sqlite3 sqlite3:))
-(declare (unit tree))
-(declare (uses margs))
-(declare (uses launch))
-;; (declare (uses megatest-version))
-(declare (uses gutils))
-(declare (uses db))
-(declare (uses server))
-;; (declare (uses synchash))
-(declare (uses dcommon))
+(import (prefix mtargs args:))
(include "megatest-version.scm")
(include "common_records.scm")
(include "db_records.scm")
(include "key_records.scm")