summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit43
1 files changed, 43 insertions, 0 deletions
diff --git a/dgit b/dgit
index 5dee815..aca89e0 100755
--- a/dgit
+++ b/dgit
@@ -6182,6 +6182,49 @@ END
next unless stat_exists "$maindir/$maybe";
push @files, $maybe;
}
+ if (open IB, "$maindir/debian/source/include-binaries") {
+ BFILE: while (<IB>) {
+ s{^[ \t]*}{};
+ s{[ \t\n]*$}{};
+ next if m{^\#};
+ next unless length;
+ our $include_binaries_warning;
+ $include_binaries_warning++ or
+ print STDERR __
+ "warning: package uses dpkg-source include-binaries feature - not all changes are visible in patches!\n";
+
+ my @bpath;
+ my $bfile_in = $_;
+ my $bpath_chk;
+ foreach my $ent (split m{/}, $bfile_in) {
+ my $wrong = sub {
+ no warnings qw(exiting);
+ print STDERR f_
+ "warning: ignoring bad include-binaries file %s: %s\n", $bfile_in, $_[0];
+ next BFILE;
+ };
+ $wrong->(f_ "forbidden path component '%s'", $ent)
+ if grep { $_ eq $ent } '', '.', '..';
+ $wrong->(f_ "path starts with '%s'", $ent)
+ if !@bpath && grep { $_ eq $ent } qw(debian .git);
+ push @bpath, $ent;
+ $bpath_chk = join '/', @bpath;
+ if (!lstat "$maindir/$bpath_chk") {
+ confess "$maindir/$bpath_chk" unless $!==ENOENT;
+ next BFILE;
+ } elsif (-f _ || -d _) {
+ } else {
+ $wrong->(f_ "path to '%s' not a plain file or directory",
+ $bpath_chk);
+ }
+ };
+ push @files, $bpath_chk;
+ }
+ IB->error and confess "$!";
+ close IB;
+ } else {
+ $! == ENOENT || confess "$!";
+ }
my $debtar= srcfn $fakeversion,'.debian.tar';
runcmd qw(tar -cf), "./$debtar", qw(-C), $maindir, @files;