The following commit has been merged in the master branch:
commit 021276c392feb8db756b125f27667f20b8295bdc
Author: Ryan Niebur <[email protected]>
Date:   Sun Feb 12 12:16:45 2012 -0800

    dget: when finding the sources.list entry for the repository to download a 
package from, match any port with the correct hostname because apt-cache policy 
does not output port numbers in URLs (Closes: #601951)

diff --git a/debian/changelog b/debian/changelog
index 243e1d2..ff4712b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,15 @@
 devscripts (2.11.4) UNRELEASED; urgency=low
 
+  [ James McCoy ]
   * bts: Revert usertags' handling of more than one +/-/=.  Only the first one
     is relevant.
 
+  [ Ryan Niebur ]
+  * dget: when finding the sources.list entry for the repository to
+    download a package from, match any port with the correct hostname
+    because apt-cache policy does not output port numbers in URLs
+    (Closes: #601951)
+
  -- James McCoy <[email protected]>  Wed, 18 Jan 2012 20:25:01 -0500
 
 devscripts (2.11.3) unstable; urgency=low
diff --git a/scripts/dget.pl b/scripts/dget.pl
index 20d8610..5536b7a 100755
--- a/scripts/dget.pl
+++ b/scripts/dget.pl
@@ -319,7 +319,8 @@ sub apt_get {
 
     # find deb lines matching the hosts in the policy output
     my @repositories;
-    my $host_re = '(?:' . (join '|', map { quotemeta; } @hosts) . ')';
+    # the regexp within the map below can be removed and replaced with only 
the quotemeta statement once bug #154868 is fixed
+    my $host_re = '(?:' . (join '|', map { my $host = quotemeta; $host =~ 
s/(?<=[\\][:][\\][\/][\\][\/])([^\\:]+)(?=[\\][\/])/$1(?:[:][0-9]+\)?/g; $host; 
} @hosts) . ')';
     if (-f "/etc/apt/sources.list") {
        $apt = new IO::File("/etc/apt/sources.list") or die 
"/etc/apt/sources.list: $!";
        while (<$apt>) {

-- 
Git repository for devscripts


-- 
To unsubscribe, send mail to [email protected].

Reply via email to