This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=e02fb2e3dffbacce894d5282e94a91bd51aaaae2

commit e02fb2e3dffbacce894d5282e94a91bd51aaaae2
Author: Guillem Jover <[email protected]>
AuthorDate: Thu Jan 6 22:30:13 2022 +0100

    dpkg-genbuildinfo: Use Dpkg::Version to parse source version
    
    Do not open-code version parsing when we can let the module do that for
    us.
    
    Changelog: internal
---
 scripts/dpkg-genbuildinfo.pl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/dpkg-genbuildinfo.pl b/scripts/dpkg-genbuildinfo.pl
index e05fce048..fc1ec388d 100755
--- a/scripts/dpkg-genbuildinfo.pl
+++ b/scripts/dpkg-genbuildinfo.pl
@@ -358,13 +358,13 @@ $options{count} = 1;
 $options{offset} = 1;
 my $prev_changelog = changelog_parse(%options);
 
-my $sourceversion = $changelog->{'Binary-Only'} ?
-                    $prev_changelog->{'Version'} : $changelog->{'Version'};
+my $sourceversion = Dpkg::Version->new($changelog->{'Binary-Only'} ?
+                    $prev_changelog->{'Version'} : $changelog->{'Version'});
 my $binaryversion = Dpkg::Version->new($changelog->{'Version'});
 
 # Include .dsc if available.
 my $spackage = $changelog->{'Source'};
-(my $sversion = $sourceversion) =~ s/^\d+://;
+my $sversion = $sourceversion->as_string(omit_epoch => 1);
 
 if (build_has_any(BUILD_SOURCE)) {
     my $dsc = "${spackage}_${sversion}.dsc";

-- 
Dpkg.Org's dpkg

Reply via email to