[dpkg] 23/192: Dpkg::Source::Package: Ignore debian/files and debian/files.new by default

Ximin Luo infinity0 at debian.org
Tue Oct 17 11:03:53 UTC 2017


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

infinity0 pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit 7cdeb9bafb4512b29b40e3c74fef7ced7e03a01b
Author: Guillem Jover <guillem at debian.org>
Date:   Sat Apr 29 23:43:49 2017 +0200

    Dpkg::Source::Package: Ignore debian/files and debian/files.new by default
    
    These are generated files, and these pathnames are part of the external
    interface. With the introduction of the buildinfo support, these get
    generated even on source builds, which means that it can disrupt
    previous workflows based on not cleaning the source tree, because they
    assumed that source-only builds did not have filesystem side-effects.
---
 debian/changelog                  | 6 ++++++
 scripts/Dpkg/Source/Package.pm    | 8 ++++++--
 scripts/Dpkg/Source/Package/V1.pm | 8 ++++++--
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 549a630..10b5565 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,12 @@ dpkg (1.18.24) UNRELEASED; urgency=medium
     - Remove obsolete hardening-wrapper support from Dpkg::Vendor::Ubuntu.
       Thanks to Adam Conrad <adconrad at 0c3.net>.
     - Bump $Dpkg::Deps::VERSION to match the one documented in CHANGES.
+    - Ignore by default debian/files.new and debian/files for all source
+      formats in Dpkg::Source::Package, because these are generated files
+      with well known pathnames, part of the public interface, and with
+      dpkg-genbuildinfo always injecting .buildinfo entries into
+      debian/files, this meant this could disrupt previous workflows based
+      on not cleaning the source tree.
   * Documentation:
     - Many spelling fixes. Thanks to Josh Soref <jsoref at gmail.com>.
     - Do not include mispellings in changelogs, as that makes detecting them
diff --git a/scripts/Dpkg/Source/Package.pm b/scripts/Dpkg/Source/Package.pm
index 9a9daea..da66cd2 100644
--- a/scripts/Dpkg/Source/Package.pm
+++ b/scripts/Dpkg/Source/Package.pm
@@ -230,14 +230,18 @@ sub init_options {
     # note: this function is not called by V1 packages
     $self->{options}{diff_ignore_regex} ||= $diff_ignore_default_regex;
     $self->{options}{diff_ignore_regex} .= '|(?:^|/)debian/source/local-.*$';
+    $self->{options}{diff_ignore_regex} .= '|(?:^|/)debian/files(?:\.new)?$';
     if (defined $self->{options}{tar_ignore}) {
         $self->{options}{tar_ignore} = [ @tar_ignore_default_pattern ]
             unless @{$self->{options}{tar_ignore}};
     } else {
         $self->{options}{tar_ignore} = [ @tar_ignore_default_pattern ];
     }
-    push @{$self->{options}{tar_ignore}}, 'debian/source/local-options',
-         'debian/source/local-patch-header';
+    push @{$self->{options}{tar_ignore}},
+         'debian/source/local-options',
+         'debian/source/local-patch-header',
+         'debian/files',
+         'debian/files.new';
     # Skip debianization while specific to some formats has an impact
     # on code common to all formats
     $self->{options}{skip_debianization} //= 0;
diff --git a/scripts/Dpkg/Source/Package/V1.pm b/scripts/Dpkg/Source/Package/V1.pm
index 0e02cc3..9da9604 100644
--- a/scripts/Dpkg/Source/Package/V1.pm
+++ b/scripts/Dpkg/Source/Package/V1.pm
@@ -51,8 +51,12 @@ sub init_options {
     } else {
 	$self->{options}{diff_ignore_regex} = '(?:^|/)debian/source/local-.*$';
     }
-    push @{$self->{options}{tar_ignore}}, 'debian/source/local-options',
-         'debian/source/local-patch-header';
+    $self->{options}{diff_ignore_regex} .= '|(?:^|/)debian/files(?:\.new)?$';
+    push @{$self->{options}{tar_ignore}},
+         'debian/source/local-options',
+         'debian/source/local-patch-header',
+         'debian/files',
+         'debian/files.new';
     $self->{options}{sourcestyle} //= 'X';
     $self->{options}{skip_debianization} //= 0;
     $self->{options}{ignore_bad_version} //= 0;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list