[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/07: install: Really overwrite TARGET/var/guix/profiles/system-1-link.
From: |
Ludovic Courtès |
Subject: |
03/07: install: Really overwrite TARGET/var/guix/profiles/system-1-link. |
Date: |
Wed, 10 Jun 2015 12:00:45 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit aea9b23213b097eb689fdae1e8e9577bf71ebb8d
Author: Ludovic Courtès <address@hidden>
Date: Wed Jun 10 10:25:56 2015 +0200
install: Really overwrite TARGET/var/guix/profiles/system-1-link.
* gnu/build/install.scm (populate-root-file-system): Delete system-1-link
under TARGET, not under /. Use 'catch' and check for EEXIST instead of
(false-if-exception (delete-file ...)).
---
gnu/build/install.scm | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/gnu/build/install.scm b/gnu/build/install.scm
index 76536da..32fbe8e 100644
--- a/gnu/build/install.scm
+++ b/gnu/build/install.scm
@@ -133,9 +133,19 @@ includes /etc, /var, /run, /bin/sh, etc., and all the
symlinks to SYSTEM."
(directives (%store-directory)))
;; Add system generation 1.
- (false-if-exception (delete-file "/var/guix/profiles/system-1-link"))
- (symlink system
- (string-append target "/var/guix/profiles/system-1-link")))
+ (let ((generation-1 (string-append target
+ "/var/guix/profiles/system-1-link")))
+ (let try ()
+ (catch 'system-error
+ (lambda ()
+ (symlink system generation-1))
+ (lambda args
+ ;; If GENERATION-1 already exists, overwrite it.
+ (if (= EEXIST (system-error-errno args))
+ (begin
+ (delete-file generation-1)
+ (try))
+ (apply throw args)))))))
(define (reset-timestamps directory)
"Reset the timestamps of all the files under DIRECTORY, so that they appear
- branch master updated (329d13b -> 8ac0368), Ludovic Courtès, 2015/06/10
- 05/07: tests: Make the daemon socket explicit in guix-register test., Ludovic Courtès, 2015/06/10
- 02/07: ui: Replace the global 'symlink' binding., Ludovic Courtès, 2015/06/10
- 04/07: guix system: init: Overwrite the items in the target store., Ludovic Courtès, 2015/06/10
- 07/07: guix-register: Use C++11 range 'for' loop instead of 'foreach' macro., Ludovic Courtès, 2015/06/10
- 06/07: guix-register: Perform deduplication even when --prefix is passed., Ludovic Courtès, 2015/06/10
- 03/07: install: Really overwrite TARGET/var/guix/profiles/system-1-link.,
Ludovic Courtès <=
- 01/07: doc: Add 'help2man' to HACKING., Ludovic Courtès, 2015/06/10