X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=dgit;h=299c531214cc5a50efd193bc29de9b7d7fea820f;hb=30dfa155fe762380e2188a4e4c18e6beb5ea713e;hp=4283a27574020c2e32fe7fd0fb6a04a363af8435;hpb=1ad50a40447cf930bde69ee6b0a21b6d35c15104;p=dgit.git diff --git a/dgit b/dgit index 4283a275..299c5312 100755 --- a/dgit +++ b/dgit @@ -2532,8 +2532,8 @@ sub quiltify_tree_sentinelfiles ($) { return $r; } -sub quiltify ($$) { - my ($clogp,$target) = @_; +sub quiltify ($$$) { + my ($clogp,$target,$origtree) = @_; # Quilt patchification algorithm # @@ -2882,6 +2882,18 @@ sub quilt_fixup_multipatch ($$$) { # 5. If we had a .pc in-tree, delete it, and git-commit # 6. Back in the main tree, fast forward to the new HEAD + # Another situation we may have to cope with is gbp-style + # patches-unapplied trees. We want to detect these, so we know + # to escape into quilt_fixup_gbp. + # + # A gbp-style tree is one which is not a clean patches-applied + # tree, but _is_ a clean patches-unapplied tree. + # + # To help detect this, when we are extracting the fake dsc, we + # first extract it with --skip-patches, and then apply the patches + # afterwards with dpkg-source --before-build. That lets us save a + # tree object corresponding to .origs. + my $fakeversion="$upstreamversion-~~DGITFAKE"; my $fakedsc=new IO::File 'fake.dsc', '>' or die $!; @@ -2907,7 +2919,8 @@ END 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; @@ -2931,6 +2944,8 @@ END changedir '..'; + my $origtree=''; + quilt_fixup_mkwork($headref); my $mustdeletepc=0; @@ -2942,7 +2957,7 @@ END rename '../fake/.pc','.pc' or die $!; } - quiltify($clogp,$headref); + quiltify($clogp,$headref,$origtree); if (!open P, '>>', ".pc/applied-patches") { $!==&ENOENT or die $!;