chiark / gitweb /
On push check that we have access_giturl; this allows missing config to abort pushes...
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 1fdca6c031d113b221fa64e55be0fa54625a5109..053c76889282feb07779f54a1045005afcf063e3 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -500,12 +500,19 @@ sub cfg {
        my $dv = $defcfg{$c};
        return $dv if defined $dv;
     }
-    badcfg "need value for one of: @_";
+    badcfg "need value for one of: @_\n".
+       "$us: distro or suite appears not to be (properly) supported";
 }
 
 sub access_basedistro () {
-    return cfg("dgit-suite.$isuite.distro",
-              "dgit.default.distro");
+    if (defined $idistro) {
+       return cfg("dgit-distro.basedistro.distro",
+                  "dgit-suite.$isuite.distro",
+                  'RETURN-UNDEF') // $idistro;
+    } else {   
+       return cfg("dgit-suite.$isuite.distro",
+                  "dgit.default.distro");
+    }
 }
 
 sub access_quirk () {
@@ -1362,6 +1369,8 @@ sub dopush () {
     printdebug "actually entering push\n";
     prep_ud();
 
+    access_giturl(); # check that success is vaguely likely
+
     my $clogpfn = ".git/dgit/changelog.822.tmp";
     runcmd shell_cmd "exec >$clogpfn", qw(dpkg-parsechangelog);
 
@@ -1395,8 +1404,9 @@ sub dopush () {
     my @diffcmd = (@git, qw(diff), $diffopt, $tree);
     printcmd \*DEBUG,$debugprefix."+",@diffcmd;
     $!=0; $?=0;
-    if (system @diffcmd) {
-       if ($! && $?==256) {
+    my $r = system @diffcmd;
+    if ($r) {
+       if ($r==256) {
            fail "$dscfn specifies a different tree to your HEAD commit;".
                " perhaps you forgot to build".
                ($diffopt eq '--exit-code' ? "" :