]> git.proxmox.com Git - dab.git/commitdiff
bootstrap: tar extract: pass "keep-directory-symlink" flag
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 20 Sep 2021 11:37:20 +0000 (13:37 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 20 Sep 2021 11:37:23 +0000 (13:37 +0200)
avoid overriding symlinks, e.g., in a (future) usr-merged system

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
DAB.pm

diff --git a/DAB.pm b/DAB.pm
index df8c68cff5574132ec360d7a29d8b6eddbc56d58..590fd629517eff48d57a78bf2ba55fd9ea207784 100644 (file)
--- a/DAB.pm
+++ b/DAB.pm
@@ -1401,9 +1401,9 @@ sub bootstrap {
        my $filename = $self->getpkgfile ($p);
        my $content = $self->run_command("ar -t '$self->{cachedir}/$filename'", undef, 1);
        if ($content =~ m/^data.tar.xz$/m) {
-           $self->run_command ("ar -p '$self->{cachedir}/$filename' data.tar.xz | tar -C '$rootdir' -xJf -");
+           $self->run_command ("ar -p '$self->{cachedir}/$filename' data.tar.xz | tar -C '$rootdir' -xJf - --keep-directory-symlink");
        } else {
-           $self->run_command ("ar -p '$self->{cachedir}/$filename' data.tar.gz | tar -C '$rootdir' -xzf -");
+           $self->run_command ("ar -p '$self->{cachedir}/$filename' data.tar.gz | tar -C '$rootdir' -xzf - --keep-directory-symlink");
        }
     }