X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=e10483894bb1084ae5693cf94c1347d959216c1a;hp=8c7f288a75597f8086d02ecb25a3be1a43416226;hb=0c244082ddb4b2443ccfbc1c438ead4fda1c33ca;hpb=0457c2d771ef6fe6c0883344add9dd4da0c60917 diff --git a/dgit b/dgit index 8c7f288a..e1048389 100755 --- a/dgit +++ b/dgit @@ -101,7 +101,11 @@ our %forceopts = map { $_=>0 } our %format_ok = map { $_=>1 } ("1.0","3.0 (native)","3.0 (quilt)"); our $suite_re = '[-+.0-9a-z]+'; -our $cleanmode_re = qr{(?:dpkg-source(?:-d)?|git|git-ff|check|none)}; +our $cleanmode_re = qr{(?: dpkg-source (?: -d )? (?: ,no-check | ,all-check )? + | git | git-ff + | check (?: ,ignores )? + | none + )}x; our $git_authline_re = '^([^<>]+) \<(\S+)\> (\d+ [-+]\d+)$'; our $splitbraincache = 'dgit-intern/quilt-cache'; @@ -6199,34 +6203,71 @@ sub maybe_unapply_patches_again () { #----- other building ----- -our $clean_using_builder; -# ^ tree is to be cleaned by dpkg-source's builtin idea that it should -# clean the tree before building (perhaps invoked indirectly by -# whatever we are using to run the build), rather than separately -# and explicitly by us. +sub clean_tree_check_git ($$) { + my ($honour_ignores, $message) = @_; + my @cmd = (@git, qw(clean -dn)); + push @cmd, qw(-x) unless $honour_ignores; + my $leftovers = cmdoutput @cmd; + if (length $leftovers) { + print STDERR $leftovers, "\n" or confess $!; + fail $message; + } +} + +sub clean_tree_check_git_wd ($) { + my ($message) = @_; + return if $cleanmode =~ m{no-check}; + return if $patches_applied_dirtily; # yuk + clean_tree_check_git +($cleanmode !~ m{all-check}), + (f_ <