summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit31
1 files changed, 28 insertions, 3 deletions
diff --git a/dgit b/dgit
index 441114d..254e3fb 100755
--- a/dgit
+++ b/dgit
@@ -45,6 +45,7 @@ our $ignoredirty = 0;
our $noquilt = 0;
our $existing_package = 'dpkg';
our $cleanmode = 'dpkg-source';
+our $changes_since_version;
our $we_are_responder;
our $initiator_tempdir;
@@ -113,8 +114,6 @@ sub dscfn ($) {
return "${package}_".(stripepoch $vsn).".dsc";
}
-sub changesopts () { return @changesopts[1..$#changesopts]; }
-
our $us = 'dgit';
our $debugprefix = '';
@@ -1690,6 +1689,26 @@ sub build_prep () {
build_maybe_quilt_fixup();
}
+sub changesopts () {
+ my @opts =@changesopts[1..$#changesopts];
+ if (!defined $changes_since_version) {
+ my @vsns = archive_query('archive_query');
+ if (@vsns) {
+ @vsns = map { $_->[0] } @vsns;
+ @vsns = sort { version_compare_string($a, $b) } @vsns;
+ $changes_since_version = $vsns[0];
+ progress "changelog will contain changes since $vsns[0]";
+ } else {
+ $changes_since_version = '_';
+ progress "package seems new, not specifying -v<version>";
+ }
+ }
+ if ($changes_since_version ne '_') {
+ unshift @opts, "-v$changes_since_version";
+ }
+ return @opts;
+}
+
sub cmd_build {
badusage "dgit build implies --clean=dpkg-source"
if $cleanmode ne 'dpkg-source';
@@ -1818,6 +1837,9 @@ sub parseopts () {
} elsif (m/^--new$/) {
push @ropts, $_;
$new_package=1;
+ } elsif (m/^--since-version=([^_]+|_)$/) {
+ push @ropts, $_;
+ $changes_since_version = $1;
} elsif (m/^--(\w+)=(.*)/s &&
($om = $opts_opt_map{$1}) &&
length $om->[0]) {
@@ -1871,7 +1893,10 @@ sub parseopts () {
} elsif (s/^-N/-/) {
push @ropts, $&;
$new_package=1;
- } elsif (m/^-[vm]/) {
+ } elsif (s/^-v([^_]+|_)$//s) {
+ push @ropts, $&;
+ $changes_since_version = $1;
+ } elsif (m/^-m/) {
push @ropts, $&;
push @changesopts, $_;
$_ = '';