Package: netselect-apt
Version: 0.3.ds1-25
Followup-For: Bug #750952

Dear Maintainer,

Please find attached a patch that should close this bug. While I was
at it, I fixed #713838 as well. 

The problem is actually a bug in the netselect package (I'll file
another bug report for that). However, a simple workaround is to
ignore obviously corrupted results by throwing out any host with
a negative score.



-- System Information:
Debian Release: jessie/sid
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages netselect-apt depends on:
ii  netselect  0.3.ds1-25
ii  wget       1.15-1+b1

Versions of packages netselect-apt recommends:
ii  curl  7.37.0-1+b1

Versions of packages netselect-apt suggests:
ii  dpkg-dev  1.17.10

-- no debconf information
--- /usr/bin/netselect-apt	2012-05-06 14:22:22.000000000 -0700
+++ /root/netselect-apt	2014-07-18 16:59:15.435949993 -0700
@@ -191,6 +191,16 @@
         [ -n "$DEBUG" ] && log "DEBUG: Running netselect: 'netselect $netselect_options $hosts'"
 	out=`netselect $netselect_options  $hosts`
 	rv=$?
+	# Throw away hosts with negative scores to workaround a netselect bug.
+	# (netselect 0.3.ds1-25 seems to have problems pinging round-robin DNS)
+	corruptedhosts=$(echo "$out" | egrep '^ *-')
+	if [ $? -eq 0 ]; then
+		log "Detected corrupt scores from bug in netselect: $corruptedhosts"
+		out=$(echo "$out" | sed -e '/^-/d')
+	fi
+
+
+	# Remove the score number leaving just the host.
         echo $out | sed -e 's/[0-9]\+\s\+/ /g'
 	return $rv
 }
@@ -244,7 +254,7 @@
 {
 	log "Usage: netselect-apt [OPTIONS] [ debian_release ]"
 	log "       debian_release is one of stable, testing, unstable, experimental"
-	log "       or a codename etch, lenny, squeeze, sid"
+	log "       or a codename etch, lenny, squeeze, wheezy, jessie, sid"
 	log "Options:"
 	log "   -a, --arch ARCH        Use mirrors containing arch ($arch)"
 	log "   -s, --sources          Include deb-src lines in generated file (no)"
@@ -310,7 +320,7 @@
 # distro is a non-option for backward compatibility
 case "$1" in
 	# don't forget to update the usage with new codenames
-	stable|testing|unstable|experimental|etch|lenny|squeeze|wheezy|sid) distro="$1" ;;
+	stable|testing|unstable|experimental|etch|lenny|squeeze|wheezy|jessie|sid) distro="$1" ;;
 	'') ;;
 	*) log "Invalid distribution: $1"; exit 1 ;;
 esac

Reply via email to