chiark / gitweb /
dgit: dsc Dgit field handling: Parse additional data
[dgit.git] / dgit
diff --git a/dgit b/dgit
index eb6fb9cd5970169854b0a5f85551b746c03c23d9..7d2dd8516386285f22afa0da28f162bc825b457e 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1683,6 +1683,7 @@ sub create_remote_git_repo () {
 }
 
 our ($dsc_hash,$lastpush_mergeinput);
+our ($dsc_distro, $dsc_hint_tag, $dsc_hint_url);
 
 our $ud = '.git/dgit/unpack';
 
@@ -2712,8 +2713,15 @@ sub parse_dsc_field ($$) {
     }
     if (!defined $f) {
        progress "$what: NO git hash";
-    } elsif ($f =~ m/^\w+/) {
+    } elsif (($dsc_hash, $dsc_distro, $dsc_hint_tag, $dsc_hint_url)
+            = $f =~ m/^(\w+) ($distro_re) ($versiontag_re) (\S+)(?:\s|$)/) {
+       progress "$what: specified git info ($dsc_distro)";
+       $dsc_hint_tag = [ $dsc_hint_tag ];
+    } elsif ($f =~ m/^\w+\s*$/) {
        $dsc_hash = $&;
+       $dsc_distro //= 'debian';
+       $dsc_hint_tag = [ debiantags +(getfield $dsc, 'Version'),
+                         $dsc_distro ];
        progress "$what: specified git hash";
     } else {
        fail "$what: invalid Dgit info";