* 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.
This commit is contained in:
Kees Cook 2008-06-13 11:46:23 -07:00
parent 62c5cb5f0b
commit b1669fec32
4 changed files with 74 additions and 46 deletions

9
debian/changelog vendored
View File

@ -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 <kees@ubuntu.com> Fri, 13 Jun 2008 11:10:44 -0700
-- Kees Cook <kees@ubuntu.com> Fri, 13 Jun 2008 11:43:24 -0700
ubuntu-dev-tools (0.30) hardy; urgency=low

2
debian/control vendored
View File

@ -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)

30
debian/copyright vendored
View File

@ -21,23 +21,23 @@ Upstream Authors:
Copyright:
Canonical Ltd. 2006-2008
Albert Damen <albrt@gmx.net> 2007
Albin Tonnerre <lut1n.tne@gmail.com> 2006-2007
Daniel Holbach <daniel.holbach@ubuntu.com> 2006-2007
Luke Yelavich <themuso@ubuntu.com> 2006-2007
Martin Pitt <martin.pitt@ubuntu.com> 2007
Michael Bienia <geser@ubuntu.com> 2006-2007
Kees Cook <kees@ubuntu.com> 2006-2008
Pete Savage <petesavage@ubuntu.com> 2006-2007
Siegfried-A. Gevatter <rainct@ubuntu.com> 2007-2008
Terence Simpson <stdin@stdin.me.uk> 2007
(C) 2006-2008, Canonical Ltd.
(C) 2007, Albert Damen <albrt@gmx.net>
(C) 2006-2007, Albin Tonnerre <lut1n.tne@gmail.com>
(C) 2006-2007, Daniel Holbach <daniel.holbach@ubuntu.com>
(C) 2006-2007, Luke Yelavich <themuso@ubuntu.com>
(C) 2007, Martin Pitt <martin.pitt@ubuntu.com>
(C) 2006-2007, Michael Bienia <geser@ubuntu.com>
(C) 2006-2008, Kees Cook <kees@ubuntu.com>
(C) 2006-2007, Pete Savage <petesavage@ubuntu.com>
(C) 2007-2008, Siegfried-A. Gevatter <rainct@ubuntu.com>
(C) 2007, Terence Simpson <stdin@stdin.me.uk>
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

View File

@ -1,15 +1,11 @@
#!/usr/bin/perl
# Copyright 2007 (C) Kees Cook <kees@ubuntu.com>
# License: GPLv2
# Copyright 2007-2008 Kees Cook <kees@ubuntu.com>
# 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";
print "Want '$file'\n";
if (! -r "$file") {
warn "Trying $urlbase/$file ...\n";
if (! -r "$file") {
system("wget $urlbase/$file");
return 0 if ($? != 0);
}
warn "Pulling source of $urlbase/$file ...\n";
# Parse the .dsc file for list of required files...
my @needed;
open(DSC,"$file") || return 0;
while (my $line=<DSC>) {
if ($line =~ /^Files:/) {
while (my $file=<DSC>) {
chomp($file);
last if ($file !~ /^ /);
my @parts = split(/\s+/,$file);
my $want = pop(@parts);
print "Want '$want'\n";
push(@needed,$want);
}
}
}
close(DSC);
$file = "${pkg}_${version}.diff.gz";
foreach my $file (@needed) {
if (! -r "$file") {
warn "Pulling $urlbase/$file ...\n";
system("wget $urlbase/$file");
return 0 if ($? != 0);
}
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);
}
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;
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 ($srcdir = readdir(DIR)) {
last if ($srcdir =~ /^${pkg}-/ && -d $srcdir);
while ($dir = readdir(DIR)) {
if ($dir =~ /^${pkg}-/ && -d $dir) {
$srcdir = $dir;
last;
}
}
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=<LOG>) {
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);