summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdgit15
1 files changed, 9 insertions, 6 deletions
diff --git a/dgit b/dgit
index 5f923aa..af62eb5 100755
--- a/dgit
+++ b/dgit
@@ -222,6 +222,12 @@ sub changespat ($;$) {
return "${package}_".(stripepoch $vsn)."_".($arch//'*').".changes";
}
+sub upstreamversion ($) {
+ my ($vsn) = @_;
+ $vsn =~ s/-[^-]+$//;
+ return $vsn;
+}
+
our $us = 'dgit';
initdebug('');
@@ -1855,8 +1861,7 @@ sub generate_commits_from_dsc () {
# from the debian/changelog, so we record the tree objects now and
# make them into commits later.
my @tartrees;
- my $upstreamv = $dsc->{version};
- $upstreamv =~ s/-[^-]+$//;
+ my $upstreamv = upstreamversion $dsc->{version};
my $orig_f_base = srcfn $upstreamv, '';
foreach my $fi (@dfi) {
@@ -3389,8 +3394,7 @@ END
my $dgithead = $actualhead;
my $maintviewhead = undef;
- my $upstreamversion = $clogp->{Version};
- $upstreamversion =~ s/-[^-]*$//;
+ my $upstreamversion = upstreamversion $clogp->{Version};
if (madformat_wantfixup($format)) {
# user might have not used dgit build, so maybe do this now:
@@ -4481,8 +4485,7 @@ END
prep_ud();
changedir $ud;
- my $upstreamversion=$version;
- $upstreamversion =~ s/-[^-]*$//;
+ my $upstreamversion = upstreamversion $version;
if ($fopts->{'single-debian-patch'}) {
quilt_fixup_singlepatch($clogp, $headref, $upstreamversion);