Commit 71972b91 authored by Eric Timmons's avatar Eric Timmons
Browse files

cli less work: update

parent 68660779
......@@ -6,18 +6,12 @@
(uiop:define-package #:clpm-cli/commands/update
(:use #:cl
#:clpm-cli/common-args
#:clpm-cli/interface-defs
#:clpm/config
#:clpm/context
#:clpm/install
#:clpm/log
#:clpm/update)
(:import-from #:adopt))
#:clpm-cli/interface-defs)
(:import-from #:adopt)
(:import-from #:clpm))
(in-package #:clpm-cli/commands/update)
(setup-logger)
(defparameter *option-update-yes*
(adopt:make-option
:update-yes
......@@ -49,10 +43,8 @@
(define-cli-command (("update") *update-ui*) (args options)
(let ((system-names args)
(project-names (gethash :update-projects options))
(context-name (config-value :context))
(yes-p (gethash :update-yes options)))
(update :validate (make-diff-validate-fun :yesp yes-p)
:context context-name
(clpm:update :validate (make-diff-validate-fun :yesp yes-p)
:update-systems system-names
:update-projects project-names)
t))
......@@ -7,12 +7,18 @@
(:nicknames #:clpm)
(:use #:cl
#:clpm/bundle
#:clpm/config
#:clpm/context
#:clpm/context-diff
#:clpm/install
#:clpm/source
#:clpm/update
#:clpm/version)
(:export #:install)
;; From config
(:export #:config-value)
;; From update
(:export #:update)
;; From version
(:export #:clpm-version))
......
......@@ -11,6 +11,7 @@
#:clpm/install/defs
#:clpm/log
#:clpm/resolve
#:clpm/session
#:clpm/source)
(:export #:update))
......@@ -21,6 +22,7 @@
(defun update (&key update-projects update-systems
(validate (constantly t))
context)
(with-clpm-session ()
(let* ((orig-context (get-context context))
(context (copy-context orig-context)))
;; Map all systems to their corresponding projects.
......@@ -38,4 +40,4 @@
(when (funcall validate diff)
(mapc #'install-release (context-releases new-context))
(context-write-asdf-files new-context)
(save-context new-context)))))
(save-context new-context))))))
Supports Markdown
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