From eec4c44fc78efa492d4eea5ff69089b6b86979e1 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Fri, 15 May 2015 01:17:44 +0200 Subject: Make sure to deduplicate package list in download_release (Closes: #709751, #768445, #785276). Do so to avoid issues while counting downloaded packages. The failure path could lead to printing some strange integer. This was reported to mostly happen whenever --no-resolve-deps is used. --- debian/changelog | 9 +++++++++ functions | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5911665..0350d3c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debootstrap (1.0.69) UNRELEASED; urgency=medium + + * Make sure to deduplicate package list in download_release to avoid + issues while counting downloaded packages. The failure path could lead + to printing some strange integer (Closes: #709751, #768445, #785276). + This was reported to mostly happen whenever --no-resolve-deps is used. + + -- Cyril Brulebois Thu, 14 May 2015 23:52:52 +0200 + debootstrap (1.0.68) unstable; urgency=medium [ Steven Chamberlain ] diff --git a/functions b/functions index bf999f1..c8d7787 100644 --- a/functions +++ b/functions @@ -662,6 +662,11 @@ download_release () { local totaldebs=0 local leftoverdebs="$*" + + # Fix possible duplicate package names, which would screw up counts: + leftoverdebs=$(printf "$leftoverdebs"|sed 's/ /\n/g'|sort -u|xargs) + numdebs=$(printf "$leftoverdebs"|wc -w) + for c in $COMPONENTS; do if [ "$countdebs" -ge "$numdebs" ]; then break; fi -- cgit v0.12