Verified Commit e6b571dd authored by Eric Timmons's avatar Eric Timmons
Browse files

Add clpm bundle systems and CLPM-CLIENT:CONTEXT-SYSTEM-NAMES

parent 5dba7829
Pipeline #5515 passed with stages
in 29 minutes and 54 seconds
......@@ -8,8 +8,10 @@
+ Update ESRAP, to support latest versions of SBCL.
+ Fix handling of :REQUIRE dependencies produced by the groveler.
+ Use ASDF 3.3.5.3 in groveler, instead of whatever is bundled with the
implementation.
implementation, unless the groveler already has ASDF loaded.
+ Fix problems loading SSL on macOS Monterey.
+ Added =clpm-client:context-system-names= and =clpm bundle systems= to
return/print a list of system names installed in a context.
* v0.4.1 - 2021-10-07
......
......@@ -10,6 +10,7 @@
#:clpm-cli/commands/bundle/init
#:clpm-cli/commands/bundle/install
#:clpm-cli/commands/bundle/source-registry
#:clpm-cli/commands/bundle/systems
#:clpm-cli/commands/bundle/update))
(in-package #:clpm-cli/commands/bundle)
;;;; clpm bundle systems
;;;;
;;;; This software is part of CLPM. See README.org for more information. See
;;;; LICENSE for license information.
(uiop:define-package #:clpm-cli/commands/bundle/systems
(:use #:cl
#:clpm-cli/commands/bundle/common
#:clpm-cli/common-args
#:clpm-cli/interface-defs)
(:import-from #:adopt)
(:import-from #:clpm))
(in-package #:clpm-cli/commands/bundle/systems)
(defparameter *bundle-systems-ui*
(adopt:make-interface
:name "clpm bundle systems"
:summary "Common Lisp Project Manager Bundle Systems"
:usage "bundle systems [options]"
:help "Print the systems present in the bundle."
:contents (list *group-common*
*group-bundle*)))
(define-cli-command (("bundle" "systems") *bundle-systems-ui*) (args options)
(declare (ignore args options))
(format t "~{~A~%~}" (clpm:bundle-installed-systems))
t)
......@@ -148,6 +148,9 @@ directories containing the files."
(clpm-proc-print proc `(source-registry :context ,context :ignore-inherited-source-registry ,ignore-inherited :with-client-p t))
(clpm-proc-read proc)))
(defun context-system-names (&key (context (default-context)))
(context-installed-system-names :context context))
(defun activate-context (context &key (activate-asdf-integration *activate-asdf-integration*)
(ignore-inherited-source-registry (context-bundle-p context)))
"Activate a CLPM context. This clears ASDF's current configuration and
......
......@@ -36,6 +36,7 @@
#:context-diff-needs-approval-diff
#:context-diff-release-diffs
#:context-source-registry
#:context-system-names
#:deactivate-asdf-integration
#:default-context
#:inside-bundle-exec-p
......
......@@ -18,6 +18,7 @@
(:export #:bundle-exec
#:bundle-init
#:bundle-install
#:bundle-installed-systems
#:bundle-output-translations
#:bundle-source-registry
#:bundle-update))
......@@ -106,6 +107,9 @@ the lock file if necessary."
:update-projects (or update-projects t)
:save-context-p t)))))
(defun bundle-installed-systems (&key clpmfile)
(installed-system-names :context (clpmfile-pathname clpmfile)))
(defun bundle-exec (command args &key clpmfile
with-client-p)
"exec(3) (or approximate if system doesn't have exec) a COMMAND in bundle's context
......
......@@ -23,6 +23,7 @@
(:export #:bundle-exec
#:bundle-init
#:bundle-install
#:bundle-installed-systems
#:bundle-source-registry
#:bundle-update)
;; From client
......
......@@ -6,6 +6,15 @@
(clpm '("bundle" "install" "-y")
:output :interactive
:error-output :interactive)
(let ((systems
(uiop:split-string
(clpm '("bundle" "systems")
:output '(:string :stripped t)
:error-output t)
:separator '(#\Newline))))
(para:true (alex:set-equal '("alexandria" "pln-support" "pln-support/pln-support")
systems
:test #'equal)))
(clpm `("bundle" "exec"
"--"
"sbcl" "--non-interactive" "--no-userinit" "--no-sysinit"
......
......@@ -6,6 +6,15 @@
(clpm '("bundle" "install" "-y" "--no-resolve")
:output :interactive
:error-output :interactive)
(let ((systems
(uiop:split-string
(clpm '("bundle" "systems")
:output '(:string :stripped t)
:error-output t)
:separator '(#\Newline))))
(para:true (alex:set-equal '("alexandria" "quicklisp-bundle")
systems
:test #'equal)))
(clpm '("bundle" "exec"
"--"
"sbcl" "--non-interactive" "--no-userinit" "--no-sysinit"
......@@ -14,3 +23,12 @@
"--quit")
:output :interactive
:error-output :interactive))))
(para:define-test quicklisp-bundle-with-client
(uiop:with-current-directory ((asdf:system-relative-pathname :clpm "test/quicklisp-bundle/"))
(let ((*default-pathname-defaults* (uiop:getcwd)))
(with-clpm-env (:config-dir :global :data-dir data-dir)
(clpm-client:install :context (merge-pathnames "clpmfile") :validate (constantly t))
(para:true (alex:set-equal '("alexandria" "quicklisp-bundle")
(clpm-client:context-system-names :context (merge-pathnames "clpmfile"))
:test #'equal))))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment