pull-debian-source: Return the most recent source line.

pull-debian-source: Return the most recent source line. Depend on
libapt-pkg-perl for the Debian version comparison required for this.
This commit is contained in:
Iain Lane 2009-12-22 22:27:04 +00:00
parent 0a3d905cf4
commit acd67abdb5
3 changed files with 18 additions and 5 deletions

6
debian/changelog vendored
View File

@ -14,7 +14,11 @@ ubuntu-dev-tools (0.86) UNRELEASED; urgency=low
* ubuntutools/requestsync/mail.py: rmadison() returns now the most recent
source line (Closes: #560758)
-- Michael Bienia <geser@ubuntu.com> Sun, 20 Dec 2009 15:40:40 +0100
[ Iain Lane ]
* pull-debian-source: Return the most recent source line. Depend on
libapt-pkg-perl for the Debian version comparison required for this.
-- Iain Lane <laney@ubuntu.com> Tue, 22 Dec 2009 22:26:07 +0000
ubuntu-dev-tools (0.85) lucid; urgency=low

3
debian/control vendored
View File

@ -16,7 +16,8 @@ Depends: ${python:Depends}, ${misc:Depends}, binutils, devscripts, sudo,
python-debian, python-launchpadlib, dctrl-tools, lsb-release, diffstat,
dpkg-dev, python-apt (>= 0.7.9), python-lazr.restfulclient
Recommends: bzr, pbuilder | cowdancer | sbuild, reportbug (>= 3.39ubuntu1),
ca-certificates, debootstrap, genisoimage, perl-modules, libwww-perl
ca-certificates, debootstrap, genisoimage, perl-modules, libwww-perl,
libapt-pkg-perl
Conflicts: devscripts (<< 2.10.7ubuntu5)
Replaces: devscripts (<< 2.10.7ubuntu5)
Description: useful tools for Ubuntu developers

View File

@ -22,6 +22,7 @@ use strict;
use LWP::Simple;
use File::Basename;
use Getopt::Long;
use AptPkg::Version;
die("Please install 'devscripts'\n") if(! grep -x "$_/dget", split(':',$ENV{'PATH'}));
@ -89,9 +90,11 @@ sub getDSC {
die("$madison");
}
my($baseURL)='http://ftp.debian.org/debian/pool/';
my($url)=$baseURL;
my(@madison)=split(/\n/,$madison);
my %urls;
my $url;
foreach my $line (@madison) {
$url = $baseURL;
my($package,$version,$release,$archs)=split(/\|/,$line,4);
$package=~s/\s*//g;
$version=~s/\s*//g;
@ -117,10 +120,15 @@ sub getDSC {
$url .= 'main/';
}
$url .= $firstLetter . '/' . $package . '/' . $package . '_' . $version . '.dsc';
return $url;
$urls{$version} = $url;
}
}
die("Unable To Find Source Package On Madison\n");
my @vers = reverse sort AptPkg::Version::CmpVersion keys %urls;
return $urls{$vers[0]} or die("Unable To Find Source Package On Madison\n");
}
sub usage {
my($name)=basename($0);