mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-18 21:46:35 +01:00
pull: Acquire a lock for the target profile.
This is a followup to b1fb663404
.
* guix/scripts/pull.scm (guix-pull): Wrap 'run-with-store' call in
'with-file-lock/no-wait'.
This commit is contained in:
parent
10e73bbc5e
commit
6fbd8fde2f
2 changed files with 14 additions and 6 deletions
|
@ -35,6 +35,7 @@
|
||||||
(eval . (put 'modify-services 'scheme-indent-function 1))
|
(eval . (put 'modify-services 'scheme-indent-function 1))
|
||||||
(eval . (put 'with-directory-excursion 'scheme-indent-function 1))
|
(eval . (put 'with-directory-excursion 'scheme-indent-function 1))
|
||||||
(eval . (put 'with-file-lock 'scheme-indent-function 1))
|
(eval . (put 'with-file-lock 'scheme-indent-function 1))
|
||||||
|
(eval . (put 'with-file-lock/no-wait 'scheme-indent-function 1))
|
||||||
|
|
||||||
(eval . (put 'package 'scheme-indent-function 0))
|
(eval . (put 'package 'scheme-indent-function 0))
|
||||||
(eval . (put 'origin 'scheme-indent-function 0))
|
(eval . (put 'origin 'scheme-indent-function 0))
|
||||||
|
|
|
@ -36,6 +36,8 @@ (define-module (guix scripts pull)
|
||||||
#:autoload (guix inferior) (open-inferior)
|
#:autoload (guix inferior) (open-inferior)
|
||||||
#:use-module (guix scripts build)
|
#:use-module (guix scripts build)
|
||||||
#:autoload (guix build utils) (which)
|
#:autoload (guix build utils) (which)
|
||||||
|
#:use-module ((guix build syscalls)
|
||||||
|
#:select (with-file-lock/no-wait))
|
||||||
#:use-module (guix git)
|
#:use-module (guix git)
|
||||||
#:use-module (git)
|
#:use-module (git)
|
||||||
#:use-module (gnu packages)
|
#:use-module (gnu packages)
|
||||||
|
@ -815,11 +817,16 @@ (define (guix-pull . args)
|
||||||
(if (assoc-ref opts 'bootstrap?)
|
(if (assoc-ref opts 'bootstrap?)
|
||||||
%bootstrap-guile
|
%bootstrap-guile
|
||||||
(canonical-package guile-2.2)))))
|
(canonical-package guile-2.2)))))
|
||||||
(run-with-store store
|
(with-file-lock/no-wait (string-append profile ".lock")
|
||||||
(build-and-install instances profile
|
(lambda (key . args)
|
||||||
#:dry-run?
|
(leave (G_ "profile ~a is locked by another process~%")
|
||||||
(assoc-ref opts 'dry-run?)
|
profile))
|
||||||
#:use-substitutes?
|
|
||||||
(assoc-ref opts 'substitutes?))))))))))))))
|
(run-with-store store
|
||||||
|
(build-and-install instances profile
|
||||||
|
#:dry-run?
|
||||||
|
(assoc-ref opts 'dry-run?)
|
||||||
|
#:use-substitutes?
|
||||||
|
(assoc-ref opts 'substitutes?)))))))))))))))
|
||||||
|
|
||||||
;;; pull.scm ends here
|
;;; pull.scm ends here
|
||||||
|
|
Loading…
Reference in a new issue