X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=1db2cdb0893108093911b78dcb460087ce89ee01;hp=77a9bb6025306fda3d3661a82460c73542669d89;hb=69c5b89e545bb8276b1bb20f399b8df75607d868;hpb=7c379b92923ec62699b0943831c9085c2e8e1821 diff --git a/dgit b/dgit index 77a9bb60..1db2cdb0 100755 --- a/dgit +++ b/dgit @@ -415,6 +415,8 @@ sub canonicalise_suite_madison ($$) { } sub canonicalise_suite () { + return if defined $csuite; + fail "cannot operate on $isuite suite" if $isuite eq 'UNRELEASED'; $csuite = archive_query('canonicalise_suite'); if ($isuite ne $csuite) { # madison canonicalises for us @@ -951,7 +953,7 @@ sub cmd_pull { sub cmd_push { parseopts(); badusage "-p is not allowed with dgit push" if defined $package; - runcmd @git, qw(diff --quiet HEAD); + check_not_dirty(); my $clogp = parsechangelog(); $package = getfield $clogp, 'Source'; if (@ARGV==0) { @@ -1050,15 +1052,19 @@ sub quilt_fixup_editor () { exit 0; } -sub cmd_build { - # we pass further options and args to git-buildpackage - badusage "-p is not allowed with dgit build" if defined $package; - badusage "dgit build implies --clean=dpkg-source" if defined $package; +sub build_prep () { + badusage "-p is not allowed when building" if defined $package; + check_not_dirty(); my $clogp = parsechangelog(); $isuite = getfield $clogp, 'Distribution'; $package = getfield $clogp, 'Source'; $version = getfield $clogp, 'Version'; build_maybe_quilt_fixup(); +} + +sub cmd_build { + badusage "dgit build implies --clean=dpkg-source" if defined $package; + build_prep(); my @cmd = (qw(git-buildpackage -us -uc --git-no-sign-tags), "--git-builder=@dpkgbuildpackage"); @@ -1072,15 +1078,9 @@ sub cmd_build { } sub build_source { - badusage "-p is not allowed with this action" if defined $package; - check_not_dirty(); - my $clogp = parsechangelog(); - $package = getfield $clogp, 'Source'; - $isuite = getfield $clogp, 'Distribution'; - $version = getfield $clogp, 'Version'; + build_prep(); $sourcechanges = "${package}_${version}_source.changes"; $dscfn = dscfn($version); - build_maybe_quilt_fixup(); if ($cleanmode eq 'dpkg-source') { runcmd_ordryrun (@dpkgbuildpackage, qw(-us -uc -S)), changesopts(); } else {