]> git.mdlowis.com Git - proto/sclpl.git/commitdiff
Added target for slpkg
authorMichael D. Lowis <mike@mdlowis.com>
Wed, 9 Oct 2013 15:35:14 +0000 (11:35 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Wed, 9 Oct 2013 15:35:14 +0000 (11:35 -0400)
SConstruct
source/slpkg/main.scm [new file with mode: 0644]

index bc21b18a919c6e5af5493b35ca59aa4e81bd3fc0..eaeaedb7717834147c73185baa71bf958ba5def9 100644 (file)
@@ -52,7 +52,7 @@ scheme_tester = Builder(
 # Create the Environment for this project
 scheme = Environment(
         ENV      = os.environ,
-        CCFLAGS  = [ '-explicit-use', '-I', 'inc'],
+        CCFLAGS  = [ '-I', 'inc'],
         LDFLAGS  = [],
         BUILDERS = {
             'Program': scheme_linker,
@@ -85,12 +85,18 @@ readsof.Depends('readsof', 'sof')
 # SCLPL Compiler
 src_files = find_files('source/compiler/','*.scm')
 scheme.Program(
-        target = 'build/sclpl-cc',
+        target = 'build/slc',
+        source = src_files)
+
+# SCLPL Package Manager
+src_files = find_files('source/slpkg/','*.scm')
+scheme.Program(
+        target = 'build/slpkg',
         source = src_files)
 
 # Compiler Test Suite
-scheme.TestRunner(
-        target = 'build/tests/sclpl-cc-tests',
-        source = [s for s in src_files if not s.endswith("main.scm")] +
-                 find_files('tests/compiler/','*.scm'))
+#scheme.TestRunner(
+#        target = 'build/tests/sclpl-cc-tests',
+#        source = [s for s in src_files if not s.endswith("main.scm")] +
+#                 find_files('tests/compiler/','*.scm'))
 
diff --git a/source/slpkg/main.scm b/source/slpkg/main.scm
new file mode 100644 (file)
index 0000000..a968c28
--- /dev/null
@@ -0,0 +1,60 @@
+(declare (uses library))
+
+(define slpkg-usage
+"Package manager for SCLPL (Simple Concurrent List Processing Language).
+
+Usage:
+  slpkg [COMMAND] [OPTIONS]
+
+Commands:
+  help           Show help documentation for a specific command or subcommand.
+  install        Install one or more packages from the configured sources.
+  publish        Publish a package to a specified repository.
+  remove         Remove one or more packages from this machine.
+  search         Search the repositories for packages matching a pattern.
+  show           Show detailed information about a specific package or packages.
+  source         Manage the sources from which packages will be retrieved.
+  update         Update the package lists for all configured sources.
+  upgrade        Upgrade a given package or packages.
+  upgrade-all    Upgrade all packages installed on this machine.\n")
+
+;------------------------------------------------------------------------------
+
+(define (help-cmd args)
+  (print args))
+
+(define install-cmd help-cmd)
+(define publish-cmd help-cmd)
+(define remove-cmd help-cmd)
+(define search-cmd help-cmd)
+(define show-cmd help-cmd)
+(define source-cmd help-cmd)
+(define update-cmd help-cmd)
+(define upgrade-cmd help-cmd)
+(define upgrade-all help-cmd)
+
+;------------------------------------------------------------------------------
+
+(define slpkg-commands
+  `(("help" .        ,help-cmd)
+    ("install" .     ,install-cmd)
+    ("publish" .     ,publish-cmd)
+    ("remove" .      ,remove-cmd)
+    ("search" .      ,search-cmd)
+    ("show" .        ,show-cmd)
+    ("source" .      ,source-cmd)
+    ("update" .      ,update-cmd)
+    ("upgrade" .     ,upgrade-cmd)
+    ("upgrade-all" . ,upgrade-all)))
+
+;------------------------------------------------------------------------------
+
+(define (cmd-dispatch cmd-map usage args)
+  (define sub-cmd (if (pair? args) (assoc (car args) cmd-map) '()))
+  (cond [(pair? sub-cmd) ((cdr sub-cmd) (cdr args))]
+        [else            (print usage)]))
+
+;------------------------------------------------------------------------------
+
+(cmd-dispatch slpkg-commands slpkg-usage (command-line-arguments))
+