[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#644242: debbugs pkg: debbugs-upgradestatus does not work



Package: debbugs
Version: 2.6.0
Followup-For: Bug #644242

Don,

As we discussed recently on #debbugs I have just been bitten by the original
issue reported here (that debbugs-upgradestatus does not work). However, the bug
report rather drifted away from that topic!

The issue appears to be that the readbug() and v1readbug() return include empty
keys for undefined fields.

The attached patch only adds keys with a defined value to %jointkeys and tests
them with defined rather than exists.

Mark
diff -c --label /sshx\:doc.localnet.devuan.org\:/home/leepen/debbugs-upgradestatus --label /sshx\:doc.localnet.devuan.org\:/usr/sbin/debbugs-upgradestatus /tmp/tramp.896L_0 /tmp/tramp.8969IE
--- /sshx:doc.localnet.devuan.org:/home/leepen/debbugs-upgradestatus
+++ /sshx:doc.localnet.devuan.org:/usr/sbin/debbugs-upgradestatus
@@ -90,11 +90,11 @@
         # Test new .summary file
         my $newdata = readbug($ref, $archive);
-        my %jointkeys = map { $_ => 1 } grep { $data->{$_} } keys %$data, grep { $newdata->{$_} } keys %$newdata;
+        my %jointkeys = map { $_ => 1 } (keys %$data), (keys %$newdata);
         for my $key (keys %jointkeys) {
-            unless (defined $data->{$key}) {
+            unless (exists $data->{$key}) {
                 die "BUG: $ref: key '$key' in .summary but not .status!\n";
             }
-            unless (defined $newdata->{$key}) {
+            unless (exists $newdata->{$key}) {
                 die "BUG: $ref: key '$key' in .status but not .summary!\n";
             }
             if ($data->{$key} ne $newdata->{$key}) {

Diff finished.  Mon Jan 13 13:01:13 2020

Reply to: