From 27478e3b9d01c073542a0a53635b248af63562f7 Mon Sep 17 00:00:00 2001 From: Chris Marusich Date: Thu, 31 May 2018 23:52:20 -0700 Subject: [PATCH 2/2] pack: Create the "populate directives" correctly. * guix/scripts/pack.scm (self-contained-tarball)[build](symlink->directives): Discriminate between "source" and "target" parent directories. --- guix/scripts/pack.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 35b8a7e72..e3a759e66 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -123,19 +123,19 @@ added to the pack." (match-lambda ((source '-> target) (let ((target (string-append #$profile "/" target)) - (parent (dirname source))) + (source-parent (dirname source)) + (target-parent (dirname target))) ;; 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 "/") + `(,@(if (string=? source-parent "/") '() - `((directory ,parent))) + `((directory ,source-parent))) (,source - -> ,(relative-file-name parent target))))))) + -> ,(relative-file-name target-parent target))))))) (define directives - ;; Fully-qualified symlinks. (append-map symlink->directives '#$symlinks)) ;; The --sort option was added to GNU tar in version 1.28, released -- 2.17.0