summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorCyril Brulebois <kibi@debian.org>2015-05-14 23:17:44 (GMT)
committerCyril Brulebois <kibi@debian.org>2015-05-14 23:17:44 (GMT)
commiteec4c44fc78efa492d4eea5ff69089b6b86979e1 (patch)
tree1aa850207452f97b8b0932a4b696ab44ee6648da /functions
parentd4429917df6a09fc21c1f8bb4fa525272f2ac09f (diff)
downloaddebootstrap-eec4c44fc78efa492d4eea5ff69089b6b86979e1.zip
debootstrap-eec4c44fc78efa492d4eea5ff69089b6b86979e1.tar.gz
debootstrap-eec4c44fc78efa492d4eea5ff69089b6b86979e1.tar.bz2
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.
Diffstat (limited to 'functions')
-rw-r--r--functions5
1 files changed, 5 insertions, 0 deletions
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