Package: debian-goodies
Version: 0.51
Severity: normal
File: /usr/bin/debget
Tags: patch

If apt-get were going to install more than one package, debget would download a wrong one:

$ apt-get -q2 --print-uris --reinstall install libapache-dbi-perl | grep -n 
/libapache-dbi-perl_
13:'ftp://ftp.pl.debian.org/debian/pool/main/liba/libapache-dbi-perl/libapache-dbi-perl_1.07-1_all.deb'
 libapache-dbi-perl_1.07-1_all.deb 53964 
SHA256:c2178c8619e4fee0a02033f6e672c82baaa2b034e1d1fff390a5e4527e3745df

$ debget libapache-dbi-perl
(libapache-dbi-perl -> 1.07-1)
Downloading libapache-dbi-perl from 
ftp://ftp.pl.debian.org/debian/pool/main/a/apr-util/libaprutil1-dbd-mysql_1.3.7+dfsg-1_i386.deb
[snip]


The attached patches fixes the problem.

--
Jakub Wilk
diff --git a/debget b/debget
--- a/debget
+++ b/debget
@@ -67,7 +67,7 @@
   	  version=`echo $version | sed -ne '$s/^.*: \(.*\).*$/\1/p'`
 	  echo "($pkgspec -> $version)"
   done
-  aptdata=$(apt-get -q2 --print-uris --reinstall install "$pkgspec" 2>/dev/null | head -1)
+  aptdata=$(apt-get -q2 --print-uris --reinstall install "$pkgspec" 2>/dev/null | grep -F "/${pkgspec}_")
   if [ -z "$aptdata" ] ; then
   	echo "ERROR: No APT data returned for '$pkgspec'. Sorry."
 	echo "This is probably because the package is in the local apt cache"

Reply via email to