X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=42675366103fca6876e2ea93e1e9dae95b842776;hp=46099d2ed664a610a35c8ae83d3a604ad8982c80;hb=0b08749b69a8fb9c83d38f2a59d6a40a2e206653;hpb=a72a7496720612dfaa7c4a12a00f8e484fe53004 diff --git a/dgit b/dgit index 46099d2e..42675366 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,11 @@ sub cmd_quilt_fixup { build_maybe_quilt_fixup(); } +sub cmd_version { + print "dgit version $our_version\n" or die $!; + exit 0; +} + sub parseopts () { my $om; while (@ARGV) { @@ -1210,7 +1218,9 @@ sub parseopts () { } elsif (m/^--no-sign$/) { $sign=0; } elsif (m/^--help$/) { - helponly(); + cmd_help(); + } elsif (m/^--version$/) { + cmd_version(); } elsif (m/^--new$/) { $new_package=1; } elsif (m/^--(\w+)=(.*)/s && @@ -1240,7 +1250,7 @@ sub parseopts () { if (s/^-n/-/) { $dryrun=1; } elsif (s/^-h/-/) { - helponly(); + cmd_help(); } elsif (s/^-D/-/) { open DEBUG, ">&STDERR" or die $!; $debug++;