Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
clpm
clpm
Commits
d9bd0354
Commit
d9bd0354
authored
May 19, 2020
by
Eric Timmons
Browse files
Implement BUNDLE-INSTALL with WITH-CONTEXT
parent
0baaec5a
Changes
2
Hide whitespace changes
Inline
Side-by-side
clpm/bundle.lisp
View file @
d9bd0354
...
...
@@ -80,32 +80,25 @@
(
defun
bundle-install
(
&key
clpmfile
(
validate
(
constantly
t
))
no-resolve
)
"Given a clpmfile instance, install all releases from its lock file, creating
the lock file if necessary."
(
with-bundle-session
(
clpmfile
)
(
let*
((
clpmfile
(
get-clpmfile
clpmfile
))
(
lockfile-pathname
(
clpmfile-lockfile-pathname
clpmfile
))
(
lockfile
nil
)
(
changedp
nil
))
(
unless
(
config-value
:local
)
(
dolist
(
s
(
context-sources
clpmfile
))
(
unless
(
source-can-lazy-sync-p
s
)
(
sync-source
s
))))
(
if
(
probe-file
lockfile-pathname
)
(
setf
lockfile
(
load-lockfile
lockfile-pathname
))
(
setf
lockfile
(
create-empty-lockfile
clpmfile
)))
(
if
no-resolve
(
mapc
#'
install-release
(
context-releases
lockfile
))
(
progn
;; Nuke the lockfile's requirements so that we pick up deletions from the
;; clpmfile.
(
setf
(
context-requirements
lockfile
)
nil
)
(
setf
lockfile
(
install-requirements
(
context-requirements
clpmfile
)
:context
lockfile
:validate
(
lambda
(
diff
)
(
aprog1
(
funcall
validate
diff
)
(
setf
changedp
it
)))
:update-projects
(
config-table-keys
:bundle
:local
)))
(
when
changedp
(
save-context
lockfile
))))
(
with-clpm-session
()
(
with-context
(
lockfile
(
clpmfile-pathname
clpmfile
))
(
let
((
clpmfile
(
get-clpmfile
clpmfile
)))
(
unless
(
config-value
:local
)
(
dolist
(
s
(
context-sources
clpmfile
))
(
unless
(
source-can-lazy-sync-p
s
)
(
sync-source
s
))))
(
if
no-resolve
(
mapc
#'
install-release
(
context-releases
lockfile
))
(
progn
;; Nuke the lockfile's requirements so that we pick up deletions
;; from the clpmfile.
(
setf
(
context-requirements
lockfile
)
nil
)
(
setf
(
context-user-sources
lockfile
)
(
context-user-sources
clpmfile
))
(
setf
lockfile
(
install-requirements
(
context-requirements
clpmfile
)
:context
lockfile
:validate
validate
:update-projects
(
config-table-keys
:bundle
:local
)
:save-context-p
t
)))))
lockfile
)))
...
...
clpm/context.lisp
View file @
d9bd0354
...
...
@@ -158,7 +158,7 @@ can be named, global contexts, or anonymous."))
(
defun
call-with-context
(
thunk
context-designator
)
(
if
(
context-anonymous-p
context-designator
)
(
let*
((
context-name
context-designator
)
(
let*
((
context-name
(
context-name
context-designator
)
)
(
*default-pathname-defaults*
(
uiop:pathname-directory-pathname
context-name
))
(
*vcs-project-override-fun*
(
make-vcs-override-fun
*default-pathname-defaults*
)))
(
with-config-source
(
:pathname
(
merge-pathnames
".clpm/bundle.conf"
...
...
@@ -346,8 +346,11 @@ in place with the same name. Return the new requirement if it was modified."
;; * Deserializing
(
defun
load-anonymous-context-from-pathname
(
pn
)
(
with-open-file
(
s
pn
)
(
load-context-from-stream
s
pn
)))
(
if
(
probe-file
pn
)
(
with-open-file
(
s
pn
)
(
load-context-from-stream
s
pn
))
(
make-instance
'context
:name
pn
)))
(
defun
context-downselect-sources
(
name
sources
)
(
let
((
allowed-source-names
(
config-value
:contexts
name
:sources
)))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment