]> git.donarmstrong.com Git - debbugs.git/commitdiff
ignore Extra-Source-Only: yes packages and make sure the last entry gets inserted
authorDon Armstrong <don@donarmstrong.com>
Wed, 3 Aug 2016 14:35:19 +0000 (07:35 -0700)
committerDon Armstrong <don@donarmstrong.com>
Wed, 3 Aug 2016 14:35:19 +0000 (07:35 -0700)
examples/debian/versions/build-mldbm.pl

index 9bcf44b366bf3001ae817fa84a3788481aa0b8d5..4b4d3594b26d336d1797015554cac8b19185ac4b 100755 (executable)
@@ -19,10 +19,25 @@ print "$archive/$dist/$arch\n";
 
 my $time = time;
 my ($p, $v);
+my $extra_source_only = 0;
 while (<>) {
     if (/^Package: (.*)/)    { $p = $1; }
     elsif (/^Version: (.*)/) { $v = $1; }
+    elsif (/^Extra-Source-Only: yes/) {
+        $extra_source_only = 1;
+    }
     elsif (/^$/) {
+        if ($extra_source_only) {
+            $extra_source_only = 0;
+            next;
+        }
+        update_package_version($p,$v,$time);
+    }
+}
+update_package_version($p,$v,$time) unless $extra_source_only;
+
+sub update_package_version {
+    my ($p,$v,$t) = @_;
        # see MLDBM(3pm)/BUGS
        my $tmp = $db{$p};
        # we allow multiple versions in an architecture now; this
@@ -33,5 +48,5 @@ while (<>) {
        $tmp->{$dist}{$arch}{$v} = $time if not exists
             $tmp->{$dist}{$arch}{$v};
        $db2{$p} = $tmp;
-    }
 }
+