diff options
author | Ansgar Burchardt <ansgar@debian.org> | 2016-09-20 21:52:31 (GMT) |
---|---|---|
committer | Ansgar Burchardt <ansgar@debian.org> | 2016-10-18 22:01:48 (GMT) |
commit | 316b677defc78f8e4410d047bc1e1a314abcd666 (patch) | |
tree | a42c06836f740442bdfbc8b5d0bd8e5f59be2826 | |
parent | 51a5fa009aaa4f9703b770bff9b613b06597cfeb (diff) | |
download | debootstrap-316b677defc78f8e4410d047bc1e1a314abcd666.zip debootstrap-316b677defc78f8e4410d047bc1e1a314abcd666.tar.gz debootstrap-316b677defc78f8e4410d047bc1e1a314abcd666.tar.bz2 |
Only use `tar -k` for new releases
In old releases, notably in Debian 6 (Squeeze), multiple packages ship
the same files using diversions (e.g. bash/dash). As debootstrap
naively extracts packages without implementing diversions itself, it
relies on tar replacing the files without an error.
Ideally we could use `tar --keep-directory-symlink`, but this is
likely not portable enough. So continue to use `tar -k`, but only for
future releases. Note that this requires no file conflicts among
packages debootstrap installs (which is a good idea anyway as they
might be extracted in the wrong order).
Bug: https://bugs.debian.org/838388
-rw-r--r-- | functions | 5 | ||||
-rw-r--r-- | scripts/sid | 5 |
2 files changed, 7 insertions, 3 deletions
@@ -819,6 +819,7 @@ get_debs () { ################################################################ extraction EXTRACTORS_SUPPORTED="dpkg-deb ar" +EXTRACT_DEB_TAR_OPTIONS= # Native dpkg-deb based extractors extract_dpkg_deb_field () { @@ -831,7 +832,7 @@ extract_dpkg_deb_field () { extract_dpkg_deb_data () { local pkg="$1" - dpkg-deb --fsys-tarfile "$pkg" | tar -kxf - + dpkg-deb --fsys-tarfile "$pkg" | tar $EXTRACT_DEB_TAR_OPTIONS -xf - } # Raw .deb extractors @@ -869,7 +870,7 @@ extract_ar_deb_data () { esac if type $cat_cmd >/dev/null 2>&1; then - ar -p "$pkg" "$tarball" | $cat_cmd | tar -kxf - + ar -p "$pkg" "$tarball" | $cat_cmd | tar $EXTRACT_DEB_TAR_OPTIONS -xf - else error 1 UNPACKCMDUNVL "Extracting %s requires the %s command, which is not available" "$pkg" "$cat_cmd" fi diff --git a/scripts/sid b/scripts/sid index b359d3b..511cebf 100644 --- a/scripts/sid +++ b/scripts/sid @@ -43,7 +43,10 @@ work_out_debs () { first_stage_install () { case "$CODENAME" in etch|etch-m68k|jessie|jessie-kfreebsd|lenny|squeeze|wheezy) ;; - *) setup_merged_usr ;; + *) + EXTRACT_DEB_TAR_OPTIONS="$EXTRACT_DEB_TAR_OPTIONS -k" + setup_merged_usr + ;; esac extract $required |