X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=dgit;h=37e83641324dbcdb30d9ecc4b0f4c7b7c0fb9964;hb=b1704c2f1daaabb296b2fa562692f1d2c1c3c510;hp=46099d2ed664a610a35c8ae83d3a604ad8982c80;hpb=a72a7496720612dfaa7c4a12a00f8e484fe53004;p=dgit.git diff --git a/dgit b/dgit index 46099d2e..37e83641 100755 --- a/dgit +++ b/dgit @@ -28,6 +28,8 @@ use File::Basename; use Dpkg::Version; use POSIX; +our $our_version = 'UNRELEASED'; ###substituted### + our $isuite = 'unstable'; our $idistro; our $package; @@ -230,7 +232,7 @@ sub badusage { exit 8; } -sub helponly () { +sub cmd_help () { print $helpmsg or die $!; exit 0; } @@ -1055,6 +1057,7 @@ sub build_maybe_quilt_fixup () { my $ncommits = 3; my $patchname = "auto-$version-$headref-$time"; my $msg = cmdoutput @git, qw(log), "-n$ncommits"; + mkpath '.git/dgit'; my $descfn = ".git/dgit/quilt-description.tmp"; open O, '>', $descfn or die "$descfn: $!"; $msg =~ s/\n/\n /g; @@ -1198,6 +1201,10 @@ sub cmd_quilt_fixup { build_maybe_quilt_fixup(); } +sub cmd_version { + print "dgit version $our_version\n" or die $!; +} + sub parseopts () { my $om; while (@ARGV) { @@ -1210,7 +1217,7 @@ sub parseopts () { } elsif (m/^--no-sign$/) { $sign=0; } elsif (m/^--help$/) { - helponly(); + cmd_help(); } elsif (m/^--new$/) { $new_package=1; } elsif (m/^--(\w+)=(.*)/s && @@ -1240,7 +1247,7 @@ sub parseopts () { if (s/^-n/-/) { $dryrun=1; } elsif (s/^-h/-/) { - helponly(); + cmd_help(); } elsif (s/^-D/-/) { open DEBUG, ">&STDERR" or die $!; $debug++;