}
}
-sub quiltify_trees_differ ($$) {
- my ($x,$y) = @_;
+sub quiltify_trees_differ ($$;$) {
+ my ($x,$y,$ignoregitignore) = @_;
# returns 1 iff the two tree objects differ other than in debian/
local $/=undef;
my @cmd = (@git, qw(diff-tree --name-only -z), $x, $y);
my $diffs= cmdoutput @cmd;
foreach my $f (split /\0/, $diffs) {
next if $f eq 'debian';
+ next if $f eq '.gitignore' && $ignoregitignore;
return 1;
}
return 0;
}
sub quiltify ($$$) {
- my ($clogp,$target,$origtree) = @_;
+ my ($clogp,$target,$unapplied) = @_;
# Quilt patchification algorithm
#
quilt_fixup_linkorigs($upstreamversion, $dscaddfile);
- my @files=qw(debian/source/format debian/rules);
+ my @files=qw(debian/source/format debian/rules
+ debian/control debian/changelog);
foreach my $maybe (qw(debian/patches debian/source/options)) {
next unless stat_exists "../../../$maybe";
push @files, $maybe;
$dscaddfile->($debtar);
close $fakedsc or die $!;
- runcmd qw(sh -ec), 'exec dpkg-source --no-check -x fake.dsc >/dev/null';
+ runcmd qw(sh -ec),
+ 'exec dpkg-source --no-check --skip-patches -x fake.dsc >/dev/null';
my $fakexdir= $package.'-'.(stripepoch $upstreamversion);
rename $fakexdir, "fake" or die "$fakexdir $!";
remove_stray_gits();
mktree_in_ud_here();
- changedir '..';
+ rmtree '.pc';
+
+ runcmd @git, qw(add -Af .);
+ my $unapplied=git_write_tree();
+ printdebug "fake orig tree object $unapplied\n";
- my $origtree='';
+ ensuredir '.pc';
+
+ runcmd qw(sh -ec),
+ 'exec dpkg-source --before-build . >/dev/null';
+
+ changedir '..';
quilt_fixup_mkwork($headref);
rename '../fake/.pc','.pc' or die $!;
}
- quiltify($clogp,$headref,$origtree);
+ quiltify($clogp,$headref,$unapplied);
if (!open P, '>>', ".pc/applied-patches") {
$!==&ENOENT or die $!;