From c15d546dcef28a091b0e4ee849d46ae95529a96f Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Wed, 21 Sep 2016 00:58:15 +0200 Subject: Add support for xz-compressed Packages indices Bug: https://bugs.debian.org/837649 --- debian/changelog | 6 ++++++ functions | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/debian/changelog b/debian/changelog index 27e512c..9bc36bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debootstrap (1.0.84) UNRELEASED; urgency=medium + + * Add support for xz-compressed Packages indices. (Closes: #837649) + + -- Ansgar Burchardt Wed, 21 Sep 2016 00:58:15 +0200 + debootstrap (1.0.83) unstable; urgency=medium [ Ansgar Burchardt ] diff --git a/functions b/functions index 60aea99..d2e3d21 100644 --- a/functions +++ b/functions @@ -331,6 +331,7 @@ get () { local iters=0 case "$typ" in + xz) from="$1.xz"; dest="$2.xz" ;; bz2) from="$1.bz2"; dest="$2.bz2" ;; gz) from="$1.gz"; dest="$2.gz" ;; *) from="$1"; dest="$2" ;; @@ -358,6 +359,7 @@ get () { case "$typ" in gz) gunzip "$dest" ;; bz2) bunzip2 "$dest" ;; + xz) unxz "$dest" ;; esac return 0 else @@ -566,6 +568,7 @@ download_release_indices () { local totalpkgs=0 for c in $COMPONENTS; do local subpath="$c/binary-$ARCH/Packages" + local xzi="`get_release_checksum "$reldest" "$subpath.xz"`" local bz2i="`get_release_checksum "$reldest" "$subpath.bz2"`" local gzi="`get_release_checksum "$reldest" "$subpath.gz"`" local normi="`get_release_checksum "$reldest" "$subpath"`" @@ -574,6 +577,8 @@ download_release_indices () { i="$normi" elif in_path bunzip2 && [ "$bz2i" != "" ]; then i="$bz2i" + elif in_path unxz && [ "$xzi" != "" ]; then + i="$xzi" elif in_path gunzip && [ "$gzi" != "" ]; then i="$gzi" fi @@ -591,6 +596,7 @@ download_release_indices () { for c in $COMPONENTS; do local subpath="$c/binary-$ARCH/Packages" local path="dists/$SUITE/$subpath" + local xzi="`get_release_checksum "$reldest" "$subpath.xz"`" local bz2i="`get_release_checksum "$reldest" "$subpath.bz2"`" local gzi="`get_release_checksum "$reldest" "$subpath.gz"`" local normi="`get_release_checksum "$reldest" "$subpath"`" @@ -600,6 +606,10 @@ download_release_indices () { ext="$ext $normi ." i="$normi" fi + if in_path unxz && [ "$xzi" != "" ]; then + ext="$ext $xzi xz" + i="${i:-$xzi}" + fi if in_path bunzip2 && [ "$bz2i" != "" ]; then ext="$ext $bz2i bz2" i="${i:-$bz2i}" -- cgit v0.12