From 74e65593b170e4ff076fa797083031e6b0b22edc Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Wed, 9 Oct 2013 11:35:14 -0400 Subject: [PATCH] Added target for slpkg --- SConstruct | 18 ++++++++----- source/slpkg/main.scm | 60 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 source/slpkg/main.scm diff --git a/SConstruct b/SConstruct index bc21b18..eaeaedb 100644 --- a/SConstruct +++ b/SConstruct @@ -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 index 0000000..a968c28 --- /dev/null +++ b/source/slpkg/main.scm @@ -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)) + -- 2.52.0