diff -Nru /tmp/JhEmWCQX4M/devscripts-2.10.4/debian/changelog /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/debian/changelog --- /tmp/JhEmWCQX4M/devscripts-2.10.4/debian/changelog 2007-04-23 20:23:07.000000000 +0200 +++ /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/debian/changelog 2007-04-27 23:45:04.000000000 +0200 @@ -1,3 +1,26 @@ +devscripts (2.10.4ubuntu1) gutsy; urgency=low + + * Resynchronise with Debian. Remaining changes: + - debchange: + + Add support for Ubuntu versioning. + + Allow UNRELEASED in Ubuntu distro check. + + Add -U/--upstream flag that forces original "just increment + the end" behaviour; Ubuntu is upstream for some pieces of software. + + Add --distributor= to override lsb_release output. + + Accept Ubuntu distribution "gutsy" and use it by default on Ubuntu. + - Add small test harness for debchange version increments. + - debuild: Preserve DEBEMAIL environment variable by default, so that we + can check it in dpkg-source. + - debcommit: Add option -c/--confirm to display the generated log + message and interactively ask for confirmation before committing it. + - requestsync: New script. + * requestsync: + - ask for explanation why Ubuntu changes can be dropped (patch from + Adrien Cunin) + - use gpg2 for signing if available + + -- Michael Bienia Fri, 27 Apr 2007 23:38:49 +0200 + devscripts (2.10.4) unstable; urgency=low [ Adam D. Barratt ] @@ -53,6 +76,24 @@ -- Christoph Berg Mon, 16 Apr 2007 14:56:59 +0200 +devscripts (2.10.2ubuntu1) gutsy; urgency=low + + * Resynchronise with Debian. Remaining changes: + - debchange: Add support for Ubuntu versioning. + - debchange: Allow UNRELEASED in Ubuntu distro check. + - Add small test harness for debchange version increments. + - debchange: Add -U/--upstream flag that forces original "just increment + the end" behaviour; Ubuntu is upstream for some pieces of software. + - debuild: Preserve DEBEMAIL environment variable by default, so that we + can check it in dpkg-source. + - debchange: Add --distributor= to override lsb_release output. + - debcommit: Add option -c/--confirm to display the generated log + message and interactively ask for confirmation before committing it. + - requestsync: New script. + * Accept Ubuntu distribution "gutsy" and use it by default on Ubuntu. + + -- Colin Watson Fri, 20 Apr 2007 15:29:05 +0100 + devscripts (2.10.2) unstable; urgency=low * The "zobel's birthday" upload. @@ -194,6 +235,105 @@ -- Mohammed Adnène Trojette Fri, 16 Mar 2007 21:53:35 +0100 +devscripts (2.9.27ubuntu13) feisty; urgency=low + + * requestsync: + - "Debian unstable" instead of "unstable" in the subject of the email + - "affects ubuntu/%s"; "affects distros/ubuntu/%s" doesn't work anymore + * debian/control: suggests bzr (LP: #90721) + * Freeze exception approved by Colin Watson + + -- Adrien Cunin Sat, 7 Apr 2007 16:08:02 +0200 + +devscripts (2.9.27ubuntu12) feisty; urgency=low + + * debcommit.pl: Add option -c/--confirm to display the generated log message + and interactively ask for confirmation before committing it. + * Add requestsync, due to popular request. + * Makefile: Install requestsync. + + -- Martin Pitt Thu, 29 Mar 2007 09:41:11 +0200 + +devscripts (2.9.27ubuntu11) feisty; urgency=low + + * add --distributor= to override lsb_release output. Value should exactly + match the output of lsb_release. (LP: #85366) + + -- LaMont Jones Wed, 21 Mar 2007 12:21:50 -0600 + +devscripts (2.9.27ubuntu10) feisty; urgency=low + + * debchange.pl: Set default release (for -r) to feisty for Ubuntu. + + -- Colin Watson Wed, 7 Mar 2007 12:54:09 +0000 + +devscripts (2.9.27ubuntu9) feisty; urgency=low + + * debuild.pl: Preserve DEBEMAIL environment variable by default, so that we + can check it in dpkg-source. + * debian/control: Set Ubuntu maintainer. + + -- Martin Pitt Tue, 6 Mar 2007 10:16:05 +0100 + +devscripts (2.9.27ubuntu8) feisty; urgency=low + + * debchange.pl: Add -U/--upstream flag that forces originally "just + increment the end" behaviour; Ubuntu is upstream for some pieces of + software. + + -- Scott James Remnant Wed, 14 Feb 2007 15:56:09 +0000 + +devscripts (2.9.27ubuntu7) feisty; urgency=low + + * test/debchange.pl: Add test case for versions ending in ~prop1 or + ~proposed1 + * debchanges.pl: Fix increment for those versions and keep the distribution + of the last changelog entry. + + -- Michael Bienia Wed, 31 Jan 2007 01:59:35 +0100 + +devscripts (2.9.27ubuntu6) feisty; urgency=low + + * debchange.pl: Allow repeated decimals in trailing version. + * test/debchange.pl: Add test cases to match. + + -- Kees Cook Fri, 26 Jan 2007 14:10:39 -0800 + +devscripts (2.9.27ubuntu5) feisty; urgency=low + + * debian/rules: add lsb-release to build deps (FTBFS due to tests). + + -- Kees Cook Thu, 25 Jan 2007 12:42:19 -0800 + +devscripts (2.9.27ubuntu4) feisty; urgency=low + + * debchange: correct handling of version increments for security updates. + * debian/rules, test/{Makefile,debchange.pl}: added small test harness to + verify debchange version increments. + + -- Kees Cook Thu, 25 Jan 2007 10:58:37 -0800 + +devscripts (2.9.27ubuntu3) feisty; urgency=low + + * debchange: Allow UNRELEASED in Ubuntu distro check. + + -- Colin Watson Tue, 16 Jan 2007 08:47:38 +0000 + +devscripts (2.9.27ubuntu2) feisty; urgency=low + + * debchange (aka dch): + - add support for Ubuntu versioning + - set distribution to feisty if running on Ubuntu + + -- Michael Bienia Fri, 22 Dec 2006 21:53:28 +0100 + +devscripts (2.9.27ubuntu1) feisty; urgency=low + + * debchange.pl: + - fix Ubuntu Distro check. + + -- Daniel Holbach Tue, 19 Dec 2006 17:31:26 +0100 + devscripts (2.9.27) unstable; urgency=low * checkbashisms: check for 'select' (thanks to James Abley, Ubuntu user) diff -Nru /tmp/JhEmWCQX4M/devscripts-2.10.4/debian/control /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/debian/control --- /tmp/JhEmWCQX4M/devscripts-2.10.4/debian/control 2007-04-23 20:08:32.000000000 +0200 +++ /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/debian/control 2007-04-25 18:17:41.000000000 +0200 @@ -1,11 +1,12 @@ Source: devscripts Section: devel Priority: optional -Maintainer: Devscripts Devel Team +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Devscripts Devel Team Uploaders: Julian Gilbey , Filippo Giunchedi , Joey Hess , Mohammed Adnène Trojette , Christoph Berg , Stefano Zacchiroli , James Vega , Martin Zobel-Helas , Adam D. Barratt , Luk Claes Standards-Version: 3.7.2 Build-Depends: perl (>= 5.8), debhelper (>= 5.0.0), libtimedate-perl, libwww-perl, - xsltproc, docbook-xsl, po4a (>= 0.26) + xsltproc, docbook-xsl, po4a (>= 0.26), lsb-release XS-Vcs-Browser: http://svn.debian.org/wsvn/devscripts/trunk/ XS-Vcs-Svn: svn://svn.debian.org/devscripts/trunk diff -Nru /tmp/JhEmWCQX4M/devscripts-2.10.4/debian/rules /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/debian/rules --- /tmp/JhEmWCQX4M/devscripts-2.10.4/debian/rules 2007-04-18 22:13:04.000000000 +0200 +++ /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/debian/rules 2007-04-25 18:14:47.000000000 +0200 @@ -16,6 +16,7 @@ test-stamp: # debugging info in bts? if grep -q '\$$debug *= *1' scripts/bts.pl; then exit 1; else exit 0; fi + cd test && $(MAKE) touch test-stamp build-indep: build-stamp-indep diff -Nru /tmp/JhEmWCQX4M/devscripts-2.10.4/scripts/debchange.pl /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/scripts/debchange.pl --- /tmp/JhEmWCQX4M/devscripts-2.10.4/scripts/debchange.pl 2007-04-23 20:02:07.000000000 +0200 +++ /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/scripts/debchange.pl 2007-04-25 18:23:09.000000000 +0200 @@ -88,6 +88,8 @@ Increment the Debian release number for a non-maintainer upload --qa Increment the Debian release number for a Debian QA Team upload + -U, --upstream + Increment the Debian release number without any distribution name -b, --force-bad-version Force a version to be less than the current one (e.g., when backporting) @@ -102,6 +104,8 @@ Preserve the directory name --no-preserve Do not preserve the directory name (default) + --distributor + Override the distributor ID from lsb_release. -D, --distribution Use the specified distribution in the changelog entry being edited -u, --urgency @@ -236,9 +240,10 @@ # with older debchange versions. my ($opt_help, $opt_version); my ($opt_i, $opt_a, $opt_e, $opt_r, $opt_v, $opt_b, $opt_d, $opt_D, $opt_u); -my ($opt_n, $opt_qa, $opt_c, $opt_m, $opt_create, $opt_package, @closes); +my ($opt_n, $opt_qa, $opt_U, $opt_c, $opt_m, $opt_create, $opt_package, @closes); my ($opt_news); my ($opt_ignore, $opt_level, $opt_regex, $opt_noconf); +my ($opt_distributor); Getopt::Long::Configure('bundling'); GetOptions("help|h" => \$opt_help, @@ -255,9 +260,11 @@ "p" => \$opt_p, "preserve!" => \$opt_p, "D|distribution=s" => \$opt_D, + "distributor=s" => \$opt_distributor, "u|urgency=s" => \$opt_u, "n|nmu" => \$opt_n, "qa" => \$opt_qa, + "U|upstream" => \$opt_U, "query!" => \$opt_query, "closes=s" => \@closes, "c|changelog=s" => \$opt_c, @@ -276,6 +283,16 @@ $opt_news = 'debian/NEWS' if defined $opt_news and $opt_news eq ''; +# See if we're Debian, Ubuntu or someone else, if we can +my $distributor; +if (defined $opt_distributor) { + $distributor=$opt_distributor; +} elsif (system('command -v lsb_release >/dev/null 2>&1') >> 8 == 0) { + $distributor = `lsb_release -is 2>/dev/null`; + chomp $distributor; +} +$distributor ||= 'Debian'; + if ($opt_noconf) { fatal "--no-conf is only acceptable as the first command-line option!"; } @@ -310,22 +327,14 @@ # Check the distro name given. if (defined $opt_D) { - # See if we're Debian, Ubuntu or someone else, if we can - my $distributor; - if (system('command -v lsb_release >/dev/null 2>&1') >> 8 == 0) { - $distributor = `lsb_release -is 2>/dev/null`; - chomp $distributor; - } - $distributor ||= 'Debian'; - if ($distributor eq 'Debian') { unless ($opt_D =~ /^(unstable|(stable|testing)(-security)?|oldstable-security|experimental|UNRELEASED)$/) { warn "$progname warning: Recognised distributions are: unstable, testing, stable,\nexperimental, UNRELEASED and {testing,stable,oldstable}-security.\nUsing your request anyway.\n"; $warnings++; } } elsif ($distributor eq 'Ubuntu') { - unless ($opt_D =~ /^(warty|hoary|breezy|dapper|edgy|feisty)(-updates|-security|-proposed)?$/) { - warn "$progname warning: Recognised distributions are:\n{warty,hoary,breezy,dapper,edgy,feisty}{,-updates,-security,-proposed}.\nUsing your request anyway.\n"; + unless ($opt_D =~ /^((warty|hoary|breezy|dapper|edgy|feisty|gutsy)(-updates|-security|-proposed)?|UNRELEASED)$/) { + warn "$progname warning: Recognised distributions are:\n{warty,hoary,breezy,dapper,edgy,feisty,gutsy}{,-updates,-security,-proposed} and\nUNRELEASED.\nUsing your request anyway.\n"; $warnings++; } } else { @@ -459,7 +468,12 @@ ($MAINTAINER,$EMAIL) = ($changelog{'Maintainer'} =~ /^([^<]+) <(.*)>/); fatal "No distribution in changelog!" unless exists $changelog{'Distribution'}; - $DISTRIBUTION=$changelog{'Distribution'}; + if ($distributor eq 'Ubuntu') { + # In Ubuntu uploads should go to gutsy + $DISTRIBUTION = 'gutsy'; + } else { + $DISTRIBUTION=$changelog{'Distribution'}; + } fatal "No changes in changelog!" unless exists $changelog{'Changes'}; $CHANGES=$changelog{'Changes'}; @@ -833,19 +847,25 @@ if ($VERSION =~ /(.*?)([a-yA-Y][a-zA-Z]*|\d+)$/i) { my $end=$2; my $start=$1; - # If it's not already an NMU make it so - # otherwise we can be safe if we behave like dch -i - if ($opt_n and not $start =~ /\.$/) { - $end += 0.1; - } elsif ($opt_qa and $start =~/(.*?)-(\d+)\.$/) { + if ($distributor ne 'Ubuntu' || $start =~ /(build|ubuntu|prop(osed)?)(\d+\.)*$/ || $opt_U) { + # If it's not already an NMU make it so + # otherwise we can be safe if we behave like dch -i + if ($opt_n and not $start =~ /\.$/) { + $end += 0.1; + } elsif ($opt_qa and $start =~/(.*?)-(\d+)\.$/) { # Drop NMU revision when doing a QA upload my $upstream_version = $1; my $debian_revision = $2; $debian_revision++; $start = "$upstream_version-$debian_revision"; $end = ""; + } else { + $end++; + } + # keep distribution if it is a proposed package + $DISTRIBUTION=$changelog{'Distribution'} if $start =~ /prop(osed)?(\d+\.)*$/; } else { - $end++; + $end .= "ubuntu1"; } $NEW_VERSION = "$start$end"; ($NEW_SVERSION=$NEW_VERSION) =~ s/^\d+://; @@ -954,7 +974,11 @@ $distribution =~ s/^\s+//; if ($opt_r) { # Change the distribution from UNRELEASED for release. - $distribution = $opt_D || "unstable"; + if ($distributor eq 'Ubuntu') { + $distribution = $opt_D || "gutsy"; + } else { + $distribution = $opt_D || "unstable"; + } # Set the start-line to 1, as we don't know what they want to edit $line=1; } diff -Nru /tmp/JhEmWCQX4M/devscripts-2.10.4/scripts/debcommit.pl /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/scripts/debcommit.pl --- /tmp/JhEmWCQX4M/devscripts-2.10.4/scripts/debcommit.pl 2007-04-18 22:19:26.000000000 +0200 +++ /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/scripts/debcommit.pl 2007-04-25 18:40:04.000000000 +0200 @@ -6,7 +6,7 @@ =head1 SYNOPSIS -B [B<--release>] [B<--message=>I] [B<--noact>] [I] +B [B<--release>] [B<--message=>I] [B<--noact>] [B<--confirm>] [I] =head1 DESCRIPTION @@ -41,6 +41,11 @@ Do not actually do anything, but do print the commands that would be run. +=item B<-c> B<--confirm> + +Display the generated commit message and ask for confirmation before committing +it. + =item I Specify which files to commit. Commits all files if not used. @@ -70,6 +75,7 @@ -r --release Commit a release of the package and create a tag -m --message=text Specify a commit message -n --noact Dry run, no actual commits + -c --confirm Ask for confirmation of the message before commit -h --help This message -v --version Version information EOT @@ -89,14 +95,16 @@ my $release=0; my $message; my $noact=0; +my $confirm=0; if (! GetOptions( "release" => \$release, "message=s" => \$message, "noact" => \$noact, + "confirm" => \$confirm, "help" => sub { usage(); exit 0; }, "version" => sub { version(); exit 0; }, )) { - die "Usage: debcommit [--release] [--message=text] [--noact] [files to commit]\n"; + die "Usage: debcommit [--release] [--message=text] [--noact] [--confirm] [files to commit]\n"; } my @files_to_commit = @ARGV; @@ -123,7 +131,7 @@ } else { $message=getmessage() if ! defined $message; - commit($message); + commit($message) if not $confirm or confirm($message); } sub getprog { @@ -311,6 +319,17 @@ return $ret; } +sub confirm { + my $message=shift; + print $message, "\n--\n"; + while(1) { + print "OK to commit? [Y/n] "; + $_ = ; + return 0 if /^n/i; + return 1 if /^(y|$)/i; + } +} + =head1 LICENSE This code is copyright by Joey Hess , all rights reserved. diff -Nru /tmp/JhEmWCQX4M/devscripts-2.10.4/scripts/debuild.pl /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/scripts/debuild.pl --- /tmp/JhEmWCQX4M/devscripts-2.10.4/scripts/debuild.pl 2007-04-18 22:19:26.000000000 +0200 +++ /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/scripts/debuild.pl 2007-04-25 18:14:47.000000000 +0200 @@ -396,7 +396,7 @@ # Check @ARGV for debuild options. my @preserve_vars = qw(TERM HOME LOGNAME PGPPATH GNUPGHOME GPG_AGENT_INFO - GPG_TTY FAKEROOTKEY LANG); + GPG_TTY FAKEROOTKEY LANG DEBEMAIL); @save_vars{@preserve_vars} = (1) x scalar @preserve_vars; { no locale; diff -Nru /tmp/JhEmWCQX4M/devscripts-2.10.4/scripts/Makefile /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/scripts/Makefile --- /tmp/JhEmWCQX4M/devscripts-2.10.4/scripts/Makefile 2007-04-18 22:19:26.000000000 +0200 +++ /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/scripts/Makefile 2007-04-25 18:14:47.000000000 +0200 @@ -7,9 +7,10 @@ PL_FILES := $(wildcard *.pl) SH_FILES = $(wildcard *.sh) +PY_FILES := $(wildcard *.py) LIBS = libvfork.so.0 CWRAPPERS = debpkg-wrapper -SCRIPTS = $(patsubst %.pl,%,$(PL_FILES)) $(patsubst %.sh,%,$(SH_FILES)) +SCRIPTS = $(patsubst %.pl,%,$(PL_FILES)) $(patsubst %.sh,%,$(SH_FILES)) $(patsubst %.py,%,$(PY_FILES)) GEN_MAN1S = bts.1 debcommit.1 deb-reversion.1 dget.1 licensecheck.1 \ mass-bug.1 rmadison.1 svnpath.1 @@ -28,6 +29,8 @@ %.tmp: %.pl $(VERSION_FILE) sed -e "s/###VERSION###/$(VERSION)/" $< > $@ perl -I.. -c $@ +%.tmp: %.py $(VERSION_FILE) + sed -e "s/###VERSION###/$(VERSION)/" $< > $@ %: %.tmp cp $< $@ chmod +x $@ diff -Nru /tmp/JhEmWCQX4M/devscripts-2.10.4/scripts/requestsync.py /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/scripts/requestsync.py --- /tmp/JhEmWCQX4M/devscripts-2.10.4/scripts/requestsync.py 1970-01-01 01:00:00.000000000 +0100 +++ /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/scripts/requestsync.py 2007-04-27 23:33:54.000000000 +0200 @@ -0,0 +1,122 @@ +#!/usr/bin/python +# From devscripts version ###VERSION### + +import os, os.path, sys, urllib, subprocess, smtplib + +changelog = 1 + +def cur_version_component(sourcepkg, release): + madison = subprocess.Popen(['apt-cache', 'madison', sourcepkg], stdout=subprocess.PIPE) + out = madison.communicate()[0] + assert (madison.returncode == 0) + + for l in out.splitlines(): + (pkg, version, aptsrc) = l.split('|') + if aptsrc.endswith('Sources') and aptsrc.find(release) > 0: + component = '' + for w in aptsrc.split(): + if w.startswith(release): + component = w.split('/')[1] + assert component != '' + return (version.strip(), component) + + raise Exception('apt-cache madison does not contain %s/%s' % (sourcepkg, release)) + +def debian_changelog(sourcepkg, version): + '''Return the Debian changelog from the latest up to the given version + (exclusive).''' + + ch = '' + for l in urllib.urlopen('http://changelogs.debian.net/' + sourcepkg): + if l.startswith(sourcepkg) and l.find(version + ')') > 0: + break + ch += l + + return ch + +# +# entry point +# + +if len(sys.argv) < 3: + print '''Usage: requestsync [basever] + +In some cases, the base version (fork point from Debian) cannot be determined +automatically, and you'll get a complete Debian changelog. Specify the correct +base version in that case.''' + sys.exit (1) + +(srcpkg, release) = sys.argv[1:3] +force_base_ver = None +if len(sys.argv) >= 4: + force_base_ver = sys.argv[3] +(cur_ver, component) = cur_version_component(srcpkg, release) + +# TODO: figure this out from packages.qa.debian.org; changelogs.d.n only works +# for main ATM anyway, though +debiancomponent = 'main' + +# generate bug report +report = '' + +report += ''' affects ubuntu/%s + status confirmed + subscribe ubuntu-archive + +''' % srcpkg + +report += 'Please sync %s (%s) from Debian unstable (%s).\n' % (srcpkg, component, debiancomponent) + +base_ver = cur_ver +uidx = base_ver.find('ubuntu') +if uidx > 0: + base_ver = base_ver[:uidx] + + print 'Explanation of the Ubuntu delta and why it can be dropped:' + explanation = '\nExplanation of the Ubuntu delta and why it can be dropped:\n' + while (explanation[-2:] != '\n\n'): + explanation += sys.stdin.readline() + report += explanation + +if changelog: + uidx = base_ver.find('build') + if uidx > 0: + base_ver = base_ver[:uidx] + + if force_base_ver: + base_ver = force_base_ver + + print 'Fetching changelog.' + report += 'Changelog since current %s version %s:\n\n' % (release, cur_ver) + report += debian_changelog(srcpkg, base_ver) + '\n' + +# sign it +sign_command = 'gpg' +if os.access('/usr/bin/gpg2', os.X_OK): + sign_command = 'gpg2' +if os.access('/usr/bin/gnome-gpg', os.X_OK): + sign_command = 'gnome-gpg' + +gpg = subprocess.Popen([sign_command, '--clearsign'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) +signed_report = gpg.communicate(report)[0] +assert gpg.returncode == 0 + +# generate email +myemailaddr = os.getenv('DEBEMAIL') +assert myemailaddr +to = 'new@bugs.launchpad.net' + +mail = '''From: %s +To: %s +Subject: Please sync %s (%s) from Debian unstable (%s) + +%s''' % (myemailaddr, to, srcpkg, component, debiancomponent, signed_report) + +print mail + +print 'Press enter to file this bug, Control-C to abort' +sys.stdin.readline() + +s = smtplib.SMTP('fiordland.ubuntu.com') +s.sendmail(myemailaddr, to, mail) +s.quit() diff -Nru /tmp/JhEmWCQX4M/devscripts-2.10.4/test/debchange.pl /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/test/debchange.pl --- /tmp/JhEmWCQX4M/devscripts-2.10.4/test/debchange.pl 1970-01-01 01:00:00.000000000 +0100 +++ /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/test/debchange.pl 2007-04-25 18:14:47.000000000 +0200 @@ -0,0 +1,72 @@ +#!/usr/bin/perl +use warnings; +use strict; +use File::Temp qw( tempdir ); + +my $dir = tempdir( CLEANUP => 1 ); + +sub fake_log($$) +{ + my ($dir,$ver) = @_; + my $log = "$dir/changelog"; + + open(LOG,">$log") || die "$log: $!\n"; + print LOG "testing ($ver) unstable; urgency=low\n"; + print LOG "\n"; + print LOG " * Testing\n"; + print LOG "\n"; + print LOG " -- Tester Thu, 25 Jan 2007 10:38:41 -0800\n"; + close(LOG); + + return $log; +} + +sub read_log_ver($) +{ + my ($log) = @_; + + open(LOG,"<$log") || die "$log: $!\n"; + my $line = ; + close(LOG); + + if ($line =~ /^\S+ \(([^\)]+)\) \S+; urgency=low/) { + return $1; + } + die "Corrupted changelog $log:\n$line\n"; +} + + +my %versions = ( + '12' => '12ubuntu1', + '3.4' => '3.4ubuntu1', + '3.4.5' => '3.4.5ubuntu1', + '5.6-7' => '5.6-7ubuntu1', + '5.6-7.1' => '5.6-7.1ubuntu1', + '5.6-7.1.8' => '5.6-7.1.8ubuntu1', + '2.13-14build5' => '2.13-14build6', + '0.45-2ubuntu3' => '0.45-2ubuntu4', + '0.45-2ubuntu3.1' => '0.45-2ubuntu3.2', + '0.45-2ubuntu3.1.0' => '0.45-2ubuntu3.1.1', + '1.2-3ubuntu0.1~prop1' => '1.2-3ubuntu0.1~prop2', + '1.2-3ubuntu0.1~proposed1' => '1.2-3ubuntu0.1~proposed2', +); + +my $fail=0; +my $ran=0; +foreach my $ver (sort keys %versions) { + $ran++; + + my $log = fake_log($dir,$ver); + system("../scripts/debchange.pl -c $log -i testing"); + my $check = read_log_ver($log); + + if ($check ne $versions{$ver}) { + $fail++; + warn "After incrementing $ver got $check (expecting $versions{$ver})\n"; + } +} + +print "All version increment tests passed\n" if ($fail==0); +printf("%d/%d version increment tests FAILED!\n",$fail,$ran) if ($fail>0); + +exit($fail); diff -Nru /tmp/JhEmWCQX4M/devscripts-2.10.4/test/Makefile /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/test/Makefile --- /tmp/JhEmWCQX4M/devscripts-2.10.4/test/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ /tmp/3qyFPkcx6Q/devscripts-2.10.4ubuntu1/test/Makefile 2007-04-25 18:14:47.000000000 +0200 @@ -0,0 +1,4 @@ +# Simplified Makefile for devscripts tests + +all: + ./debchange.pl