diff --git a/debian/changelog b/debian/changelog index 1808db5..d24ebcf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -40,8 +40,15 @@ ubuntu-dev-tools (0.31) UNRELEASED; urgency=low * what-patch: - restore previous output behavior, added logic to verbose test instead. - added details for each patch system report. + * pull-debian-debdiff: + - parse .dsc file for required source files. + - switch to GPLv3 + * debian/control: add Depends needed for pull-debian-debdiff. + * debian/copyright: + - updated pull-debian-debdiff, which is now GPLv3. + - adjusted Copyright lines to make lintian happy. - -- Kees Cook Fri, 13 Jun 2008 11:10:44 -0700 + -- Kees Cook Fri, 13 Jun 2008 11:43:24 -0700 ubuntu-dev-tools (0.30) hardy; urgency=low diff --git a/debian/control b/debian/control index b51804f..e770beb 100644 --- a/debian/control +++ b/debian/control @@ -13,7 +13,7 @@ Standards-Version: 3.7.3 Package: ubuntu-dev-tools Architecture: all Section: devel -Depends: ${python:Depends}, binutils, devscripts, sudo, python-launchpad-bugs (>= 0.2.25), python-debian, dctrl-tools, lsb-release +Depends: ${python:Depends}, binutils, devscripts, sudo, python-launchpad-bugs (>= 0.2.25), python-debian, dctrl-tools, lsb-release, diffstat, dpkg-dev Recommends: bzr, pbuilder, reportbug (>= 3.39ubuntu1) Conflicts: devscripts (<< 2.10.7ubuntu5) Replaces: devscripts (<< 2.10.7ubuntu5) diff --git a/debian/copyright b/debian/copyright index c97e920..57f8f62 100644 --- a/debian/copyright +++ b/debian/copyright @@ -21,23 +21,23 @@ Upstream Authors: Copyright: - Canonical Ltd. 2006-2008 - Albert Damen 2007 - Albin Tonnerre 2006-2007 - Daniel Holbach 2006-2007 - Luke Yelavich 2006-2007 - Martin Pitt 2007 - Michael Bienia 2006-2007 - Kees Cook 2006-2008 - Pete Savage 2006-2007 - Siegfried-A. Gevatter 2007-2008 - Terence Simpson 2007 + (C) 2006-2008, Canonical Ltd. + (C) 2007, Albert Damen + (C) 2006-2007, Albin Tonnerre + (C) 2006-2007, Daniel Holbach + (C) 2006-2007, Luke Yelavich + (C) 2007, Martin Pitt + (C) 2006-2007, Michael Bienia + (C) 2006-2008, Kees Cook + (C) 2006-2007, Pete Savage + (C) 2007-2008, Siegfried-A. Gevatter + (C) 2007, Terence Simpson Licenses: 404main, check-symbols, dch-repeat, dgetlp, mk-sbuild-lv, pbuilder-dist, -pull-debian-debdiff, requestsync, reverse-build-depends, submittodebian, -update-maintainer and what-patch are licensed under GPLv2: +requestsync, reverse-build-depends, submittodebian, update-maintainer +and what-patch are licensed under GPLv2: This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -51,8 +51,8 @@ update-maintainer and what-patch are licensed under GPLv2: On Debian systems, the complete text of the GNU General Public License v2 can be found in `/usr/share/common-licenses/GPL-2'. -get-branches, get-build-deps, massfile, ppaput and suspicious-source -are licensed under GPLv3: +get-branches, get-build-deps, debian-pull-debdiff, massfile, ppaput and +suspicious-source are licensed under GPLv3: This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/pull-debian-debdiff b/pull-debian-debdiff index 55b3436..08c47bb 100755 --- a/pull-debian-debdiff +++ b/pull-debian-debdiff @@ -1,15 +1,11 @@ #!/usr/bin/perl -# Copyright 2007 (C) Kees Cook -# License: GPLv2 +# Copyright 2007-2008 Kees Cook +# License GPLv3 # # This script attempts to find and download a specific version of a Debian # package and its immediate parent to generate a debdiff. # # Requirements: devscripts diffstat dpkg-dev -# -# Cleanups needed: -# - general cleanup -# - parse diff.gz/orig.tar.gz from .dsc file instead of guessing version use strict; use warnings; @@ -20,28 +16,36 @@ sub geturls my $file; $file = "${pkg}_${version}.dsc"; - warn "Trying $urlbase/$file ...\n"; + print "Want '$file'\n"; if (! -r "$file") { - + warn "Trying $urlbase/$file ...\n"; system("wget $urlbase/$file"); return 0 if ($? != 0); } - warn "Pulling source of $urlbase/$file ...\n"; - - $file = "${pkg}_${version}.diff.gz"; - if (! -r "$file") { - system("wget $urlbase/$file"); - return 0 if ($? != 0); + # Parse the .dsc file for list of required files... + my @needed; + open(DSC,"$file") || return 0; + while (my $line=) { + if ($line =~ /^Files:/) { + while (my $file=) { + chomp($file); + last if ($file !~ /^ /); + my @parts = split(/\s+/,$file); + my $want = pop(@parts); + print "Want '$want'\n"; + push(@needed,$want); + } + } } + close(DSC); - my $orig_ver = $version; - $orig_ver =~ s/-.*//; - - $file = "${pkg}_${orig_ver}.orig.tar.gz"; - if (! -r "$file") { - system("wget $urlbase/$file"); - return 0 if ($? != 0); + foreach my $file (@needed) { + if (! -r "$file") { + warn "Pulling $urlbase/$file ...\n"; + system("wget $urlbase/$file"); + return 0 if ($? != 0); + } } return 1; @@ -80,6 +84,8 @@ sub download_source if (!geturls($urlbase,$pkg,$version)) { # Try snapshot + $urlbase="http://snapshot.debian.net/package/$pkg/$version"; + warn "Fetching snapshot url via '$urlbase' ...\n"; $urlbase=`curl -sI 'http://snapshot.debian.net/package/$pkg/$version' | grep ^[lL]ocation | cut -d' ' -f2 | head -1`; $urlbase =~ s/[\r\n]//g; warn "Trying snapshot location '$urlbase' ...\n"; @@ -94,8 +100,10 @@ sub download_source } + my $pkg = $ARGV[0]; my $version = $ARGV[1]; +my $just_fetch = ($ARGV[2] && $ARGV[2] eq "--fetch"); my $skip = $ARGV[2] || 1; $skip+=0; @@ -106,19 +114,32 @@ if (!defined($pkg) || !defined($version)) { # Extract latest source die "Cannot locate $pkg $version\n" unless download_source($pkg,$version); +exit(0) if ($just_fetch); system("dpkg-source -x ${pkg}_${version}.dsc"); die "Unpack of $pkg $version failed\n" unless ($? == 0); # Locate prior changelog entry my $prev_ver; -my $srcdir; -opendir(DIR,"."); -while ($srcdir = readdir(DIR)) { - last if ($srcdir =~ /^${pkg}-/ && -d $srcdir); +my $upstream_version = $version; +if ($upstream_version =~ /^([^-]+)-/) { + $upstream_version = $1; +} +my $srcdir="$pkg-$upstream_version"; +if (! -d "$srcdir") { + undef $srcdir; + my $dir; + opendir(DIR,"."); + while ($dir = readdir(DIR)) { + if ($dir =~ /^${pkg}-/ && -d $dir) { + $srcdir = $dir; + last; + } + } + closedir(DIR); } -closedir(DIR); die "Cannot locate source tree\n" if (!defined($srcdir)); -open(LOG,"<$srcdir/debian/changelog"); +my $log = "$srcdir/debian/changelog"; +open(LOG,"<$log") || die "$log: $!\n"; while (my $line=) { if ($line =~ /^$pkg \((?:\d+:)?([^\)]+)\)/) { my $seen = $1; @@ -136,8 +157,8 @@ close(LOG); die "Cannot find earlier source version\n" if (!defined($prev_ver)); die "Cannot locate $pkg $prev_ver\n" unless download_source($pkg,$prev_ver); -system("dpkg-source -x ${pkg}_${prev_ver}.dsc"); -die "Unpack of $pkg $prev_ver failed\n" unless ($? == 0); +#system("dpkg-source -x ${pkg}_${prev_ver}.dsc"); +#die "Unpack of $pkg $prev_ver failed\n" unless ($? == 0); system("debdiff ${pkg}_${prev_ver}.dsc ${pkg}_${version}.dsc > ${pkg}_${version}.debdiff"); die "Cannot debdiff\n" unless ($? == 0);