chiark / gitweb /
canon etc. fixes
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 16 Aug 2013 19:04:58 +0000 (20:04 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 16 Aug 2013 19:04:58 +0000 (20:04 +0100)
dgit
dgit.1

diff --git a/dgit b/dgit
index 6692f55cffbd149f03605e44d01f23bd998f3145..b25c4a3d9ce558007c80321bbc7b31a88a78b040 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -33,6 +33,7 @@ our $sign = 1;
 our $dryrun = 0;
 our $changesfile;
 our $new_package = 0;
+our $existing_package = 'dpkg';
 
 our %format_ok = map { $_=>1 } ("1.0","3.0 (native)","3.0 (quilt)");
 
@@ -245,7 +246,7 @@ sub archive_query () {
 }
 
 sub canonicalise_suite () {
-    archive_query();
+    archive_query() or die;
 }
 
 sub get_archive_dsc () {
@@ -645,7 +646,7 @@ sub cmd_push {
     if (@ARGV==0) {
        $suite = $clogp->{Distribution};
        if ($new_package) {
-           local ($package) = 'dpkg';
+           local ($package) = $existing_package; # this is a hack
            canonicalise_suite();
        }
     } else {
@@ -665,7 +666,6 @@ sub cmd_build {
     my $clogp = parsechangelog();
     $suite = $clogp->{Distribution};
     $package = $clogp->{Source};
-    canonicalise_suite();
     runcmd_ordryrun
        qw(git-buildpackage -us -uc --git-no-sign-tags),
        '--git-builder=dpkg-buildpackage -i\.git/ -I.git',
@@ -690,6 +690,8 @@ sub parseopts () {
                $om->[0] = $2;
            } elsif (m/^--(\w+):(.*)/s && ($om = $opts_opt_map{$1})) {
                push @$om, $2;
+           } elsif (m/^--existing-package=(.*)/s) {
+               $existing_package = $1;
            } else {
                die "$_ ?";
            }
diff --git a/dgit.1 b/dgit.1
index 4fd00c0622983117ecf4df3114c2dbc4d29d5d67..06a7ee94e4ee78e0e2888a1ce5a143b7378b899e 100644 (file)
--- a/dgit.1
+++ b/dgit.1
@@ -139,6 +139,16 @@ debsign.  Use repeatedly if multiple additional options are required.
 Specifies the .changes file which is to be uploaded.  By default
 dgit push looks for single .changes file in the parent directory whose
 filename suggests it is for the right package and version.
+.TP
+.BI --existing-package= package
+dgit push needs to canonicalise the suite name.  But currently
+there is no way to ask the archive to do this without knowing the
+name of an existing package.  Without --new we can just use the
+package we are trying to push.  But with --new that will not work, so
+we guess that
+.B dpkg
+exists in the target suite.  If it doesn't, you can use this option to
+specify a package which does.  If the suite is empty, bad luck.
 .SH CONFIGURATION
 dgit looks at the following git config keys to control its behaviour.
 You may set them with git-config (either in system-global or per-tree
@@ -186,7 +196,9 @@ Debian Policy needs to be updated to describe the new Vcs-Dgit-Master
 field (and to specify that it is an RC bug for that field to refer
 to an unavailable commit).
 
-dgit cannot currently introduce a package into a suite.
+The method of canonicalising suite names is bizarre.  See the
+.B --existing-package
+option for one of the implication.s
 
 dgit push should perhaps do `git push origin', or something similar,
 by default.