diff options
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -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; |