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=c548669cc8547a78a5c57ae92b0c5d0a0873a77c

commit c548669cc8547a78a5c57ae92b0c5d0a0873a77c
Author: Guillem Jover <[email protected]>
AuthorDate: Thu Jan 27 01:24:24 2022 +0100

    dpkg-source: Fix alternate changelog file usage with 2.0 and 3.0 formats
    
    When generating the patch header we parse the changelog, but were not
    honoring the pathname passed to dpkg-source.
    
    Reported-by: Umut <[email protected]> (on IRC)
---
 scripts/Dpkg/Source/Package/V2.pm | 2 +-
 scripts/dpkg-source.pl            | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/scripts/Dpkg/Source/Package/V2.pm 
b/scripts/Dpkg/Source/Package/V2.pm
index eb0a49a89..a45837b40 100644
--- a/scripts/Dpkg/Source/Package/V2.pm
+++ b/scripts/Dpkg/Source/Package/V2.pm
@@ -616,7 +616,7 @@ AUTOGEN_HEADER
     }
 
     my $ch_info = changelog_parse(offset => 0, count => 1,
-        file => File::Spec->catfile($dir, 'debian', 'changelog'));
+        file => $self->{options}{changelog_file});
     return '' if not defined $ch_info;
     my $header = Dpkg::Control->new(type => CTRL_UNKNOWN);
     $header->{'Description'} = "<short summary of the patch>\n";
diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl
index f803c9510..51e9a4619 100755
--- a/scripts/dpkg-source.pl
+++ b/scripts/dpkg-source.pl
@@ -56,7 +56,6 @@ use Dpkg::Vendor qw(run_vendor_hook);
 textdomain('dpkg-dev');
 
 my $controlfile;
-my $changelogfile;
 my $changelogformat;
 
 my $build_format;
@@ -164,7 +163,7 @@ while (@options) {
     } elsif (m/^-c(.*)$/) {
         $controlfile = $1;
     } elsif (m/^-l(.*)$/) {
-        $changelogfile = $1;
+        $options{changelog_file} = $1;
     } elsif (m/^-F([0-9a-z]+)$/) {
         $changelogformat = $1;
     } elsif (m/^-D([^\=:]+)[=:](.*)$/s) {
@@ -228,10 +227,10 @@ if ($options{opmode} =~ 
/^(build|print-format|(before|after)-build|commit)$/) {
 
     $options{ARGV} = \@ARGV;
 
-    $changelogfile ||= "$dir/debian/changelog";
+    $options{changelog_file} ||= "$dir/debian/changelog";
     $controlfile ||= "$dir/debian/control";
 
-    my %ch_options = (file => $changelogfile);
+    my %ch_options = (file => $options{changelog_file});
     $ch_options{changelogformat} = $changelogformat if $changelogformat;
     my $changelog = changelog_parse(%ch_options);
     my $control = Dpkg::Control::Info->new($controlfile);

-- 
Dpkg.Org's dpkg

Reply via email to