From 316b677defc78f8e4410d047bc1e1a314abcd666 Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Tue, 20 Sep 2016 23:52:31 +0200 Subject: 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 --- functions | 5 +++-- scripts/sid | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/functions b/functions index d2e3d21..bc5401e 100644 --- a/functions +++ b/functions @@ -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 -- cgit v0.12