pack: 'guix pack -S xxx' no longer adds entries twice to the tarball.
* guix/scripts/pack.scm (self-contained-tarball)[build](symlink->directives): 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'.
This commit is contained in:
parent
30da3173d5
commit
26b8cadf88
|
@ -122,10 +122,17 @@ added to the pack."
|
||||||
;; parent directories.
|
;; parent directories.
|
||||||
(match-lambda
|
(match-lambda
|
||||||
((source '-> target)
|
((source '-> target)
|
||||||
(let ((target (string-append #$profile "/" target)))
|
(let ((target (string-append #$profile "/" target))
|
||||||
`((directory ,(dirname source))
|
(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)))
|
||||||
(,source
|
(,source
|
||||||
-> ,(relative-file-name (dirname source) target)))))))
|
-> ,(relative-file-name parent target)))))))
|
||||||
|
|
||||||
(define directives
|
(define directives
|
||||||
;; Fully-qualified symlinks.
|
;; Fully-qualified symlinks.
|
||||||
|
@ -146,9 +153,11 @@ added to the pack."
|
||||||
"")
|
"")
|
||||||
#$tar "/bin"))
|
#$tar "/bin"))
|
||||||
|
|
||||||
;; Note: there is not much to gain here with deduplication and
|
;; Note: there is not much to gain here with deduplication and there
|
||||||
;; there is the overhead of the '.links' directory, so turn it
|
;; is the overhead of the '.links' directory, so turn it off.
|
||||||
;; 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>.
|
||||||
(populate-single-profile-directory %root
|
(populate-single-profile-directory %root
|
||||||
#:profile #$profile
|
#:profile #$profile
|
||||||
#:closure "profile"
|
#:closure "profile"
|
||||||
|
@ -195,6 +204,8 @@ added to the pack."
|
||||||
(filter-map (match-lambda
|
(filter-map (match-lambda
|
||||||
(('directory directory)
|
(('directory directory)
|
||||||
(string-append "." directory))
|
(string-append "." directory))
|
||||||
|
((source '-> _)
|
||||||
|
(string-append "." source))
|
||||||
(_ #f))
|
(_ #f))
|
||||||
directives)))))))))
|
directives)))))))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue