X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=dgit;h=87ab8625018c0d5ad47e576d7b27a3c832152704;hb=dd2e4ce5738b2a41b4a18d7a8ff87a32692a2aac;hp=57e1e40d13d5c848b91a49ddd756d5bae27d1a78;hpb=c4f072101fba40bf5d387dbdd98d1459df82c67d;p=dgit.git diff --git a/dgit b/dgit index 57e1e40d..87ab8625 100755 --- a/dgit +++ b/dgit @@ -101,8 +101,8 @@ 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 +our $cleanmode_re = qr{(?: dpkg-source (?: -d )? (?: ,no-check | ,all-check )? + | (?: git | git-ff ) (?: ,always )? | check (?: ,ignores )? | none )}x; @@ -132,8 +132,8 @@ our (@mergechanges) = qw(mergechanges -f); our (@gbp_build) = (''); our (@gbp_pq) = ('gbp pq'); our (@changesopts) = (''); -our (@pbuilder) = ("sudo -E pbuilder"); -our (@cowbuilder) = ("sudo -E cowbuilder"); +our (@pbuilder) = ("sudo -E pbuilder","--no-source-only-changes"); +our (@cowbuilder) = ("sudo -E cowbuilder","--no-source-only-changes"); our %opts_opt_map = ('dget' => \@dget, # accept for compatibility 'curl' => \@curl, @@ -2197,6 +2197,12 @@ sub check_for_vendor_patches () { __ "(nominal) distro being accessed"); } +sub check_bpd_exists () { + stat $buildproductsdir + or fail f_ "build-products-dir %s is not accessible: %s\n", + $buildproductsdir, $!; +} + sub generate_commits_from_dsc () { # See big comment in fetch_from_archive, below. # See also README.dsc-import. @@ -3062,6 +3068,7 @@ END } sub fetch_from_archive () { + check_bpd_exists(); ensure_setup_existing_tree(); # Ensures that lrref() is what is actually in the archive, one way @@ -3758,10 +3765,13 @@ sub clone ($) { } printdebug "clone main body\n"; - canonicalise_suite(); - my $hasgit = check_for_git(); mkdir $dstdir or fail f_ "create \`%s': %s", $dstdir, $!; changedir $dstdir; + check_bpd_exists(); + + canonicalise_suite(); + my $hasgit = check_for_git(); + runcmd @git, qw(init -q); record_maindir(); setup_new_tree(); @@ -6203,25 +6213,47 @@ sub maybe_unapply_patches_again () { #----- other building ----- -sub clean_tree_check_git ($$) { - my ($honour_ignores, $message) = @_; +sub clean_tree_check_git ($$$) { + my ($honour_ignores, $message, $ignmessage) = @_; 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 $!; + $message .= $ignmessage if $honour_ignores; 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}), + $message, "\n".__ <