Commit 316b677d authored by Ansgar's avatar Ansgar

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
parent 51a5fa00
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment