chiark / gitweb /
-p option
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 16 Aug 2013 14:33:30 +0000 (15:33 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 16 Aug 2013 14:33:30 +0000 (15:33 +0100)
dgit
dgit.1

diff --git a/dgit b/dgit
index d160e185d21910546fa395af642a2c91c032d76a..a158eefde209e76865088d90de19ba03cf57b622 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -432,6 +432,7 @@ sub pull () {
 sub dopush () {
     runcmd @git, qw(diff --quiet HEAD);
     my $clogp = parsechangelog();
 sub dopush () {
     runcmd @git, qw(diff --quiet HEAD);
     my $clogp = parsechangelog();
+    die if defined $package;
     $package = $clogp->{Source};
     my $dscfn = "${package}_$clogp->{Version}.dsc";
     stat "../$dscfn" or die "$dscfn $!";
     $package = $clogp->{Source};
     my $dscfn = "${package}_$clogp->{Version}.dsc";
     stat "../$dscfn" or die "$dscfn $!";
@@ -488,6 +489,7 @@ sub dopush () {
 
 sub cmd_clone {
     my $dstdir;
 
 sub cmd_clone {
     my $dstdir;
+    die if defined $package;
     if (@ARGV==1) {
        ($package) = @ARGV;
     } elsif (@ARGV==2 && $ARGV[1] =~ m#^\w#) {
     if (@ARGV==1) {
        ($package) = @ARGV;
     } elsif (@ARGV==2 && $ARGV[1] =~ m#^\w#) {
@@ -514,11 +516,16 @@ sub branchsuite () {
 }
 
 sub fetchpullargs () {
 }
 
 sub fetchpullargs () {
-    my $clogp = parsechangelog();
-    $package = $clogp->{Source};
+    if (!defined $package) {
+       my $sourcep = parsecontrol('debian/control');
+       $package = $sourcep->{Source};
+    }
     if (@ARGV==0) {
        $suite = branchsuite();
     if (@ARGV==0) {
        $suite = branchsuite();
-       $suite ||= $clogp->{Distribution};
+       if (!$suite) {
+           my $clogp = parsechangelog();
+           $suite = $clogp->{Distribution};
+       }
        canonicalise_suite();
        print "fetching from suite $suite\n";
     } elsif (@ARGV==1) {
        canonicalise_suite();
        print "fetching from suite $suite\n";
     } elsif (@ARGV==1) {
@@ -540,6 +547,7 @@ sub cmd_pull {
 }
 
 sub cmd_push {
 }
 
 sub cmd_push {
+    die if defined $package;
     my $clogp = parsechangelog();
     $package = $clogp->{Source};
     if (@ARGV==0) {
     my $clogp = parsechangelog();
     $package = $clogp->{Source};
     if (@ARGV==0) {
@@ -552,6 +560,7 @@ sub cmd_push {
 }
 
 sub cmd_build {
 }
 
 sub cmd_build {
+    die if defined $package;
     my $clogp = parsechangelog();
     $suite = $clogp->{Distribution};
     $package = $clogp->{Source};
     my $clogp = parsechangelog();
     $suite = $clogp->{Distribution};
     $package = $clogp->{Source};
diff --git a/dgit.1 b/dgit.1
index 19f38684e587be5363df324e0bc35d47923c5ca0..51940cab186c946e855f9ccc7b741842e37059aa 100644 (file)
--- a/dgit.1
+++ b/dgit.1
@@ -107,6 +107,13 @@ for signing the tag and the upload.
 .BR --no-sign
 does not sign tags or uploads (meaningful only with push).
 .TP
 .BR --no-sign
 does not sign tags or uploads (meaningful only with push).
 .TP
+.TP
+.BI -p package
+Specifies that we should process source package
+.I package
+rather than looking in debian/control.  Valid with dgit fetch
+and dgit pull, only.
+.TP
 .BI -D
 Spew debugging information to stderr.
 .TP
 .BI -D
 Spew debugging information to stderr.
 .TP