[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/05: pack: 'guix pack -S xxx' no longer adds entries twice to the tarb
02/05: pack: 'guix pack -S xxx' no longer adds entries twice to the tarball.
Fri, 11 May 2018 12:44:43 -0400 (EDT)
civodul pushed a commit to branch master
in repository guix.
Author: Ludovic CourtÃ¨s <address@hidden>
Date: Fri May 11 16:56:19 2018 +0200
pack: 'guix pack -S xxx' no longer adds entries twice to the tarball.
Do not add a 'directory' directive for "/". Previously, as soon as we
were using '-S /bin=bin' or similar, we would add every entry a second
time in the tarball; this would translate as hard links in the tarball,
which tar < 1.30 sometimes fails to extract.
Pass symlinks defined in DIRECTIVES to 'tar'.
guix/scripts/pack.scm | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index db56092..6d648d1 100644
@@ -122,10 +122,17 @@ added to the pack."
;; parent directories.
((source '-> target)
- (let ((target (string-append #$profile "/" target)))
- `((directory ,(dirname source))
+ (let ((target (string-append #$profile "/" target))
+ (parent (dirname source)))
+ ;; Never add a 'directory' directive for "/" so as to
+ ;; preserve its ownnership when extracting the archive (see
+ ;; below), and also because this would lead to adding the
+ ;; same entries twice in the tarball.
+ `(,@(if (string=? parent "/")
+ `((directory ,parent)))
- -> ,(relative-file-name (dirname source) target)))))))
+ -> ,(relative-file-name parent target)))))))
;; Fully-qualified symlinks.
@@ -146,9 +153,11 @@ added to the pack."
- ;; Note: there is not much to gain here with deduplication and
- ;; there is the overhead of the '.links' directory, so turn it
- ;; off.
+ ;; Note: there is not much to gain here with deduplication and there
+ ;; is the overhead of the '.links' directory, so turn it off.
+ ;; Furthermore GNUÂ tar < 1.30 sometimes fails to extract tarballs
+ ;; with hard links:
+ ;; <http://lists.gnu.org/archive/html/bug-tar/2017-11/msg00009.html>.
@@ -195,6 +204,8 @@ added to the pack."
(string-append "." directory))
+ ((source '-> _)
+ (string-append "." source))