]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/Control.pm
Fix set_found bug which cleared partially matching versions; thanks to Andreas Beckma...
[debbugs.git] / Debbugs / Control.pm
index 74653b0a66e5d5d56210c60f0dbba16220d570f7..33db8816a2a28f5ac5de974b71cdac7f3eb5ed90 100644 (file)
@@ -1591,7 +1591,7 @@ sub set_found {
                    }
                    # if the found we are adding matches any fixed
                    # versions, remove them
-                   my @temp = grep m{(^|/)\Q$sver\E}, keys %fixed_versions;
+                   my @temp = grep m{(^|/)\Q$sver\E$}, keys %fixed_versions;
                    delete $fixed_versions{$_} for @temp;
                    $fixed_removed{$_} = 1 for @temp;
                }
@@ -1615,7 +1615,7 @@ sub set_found {
                # in the case of removal, we only concern ourself with
                # the version passed, not the source version it maps
                # to
-               my @temp = grep m{(^|/)\Q$version\E}, keys %found_versions;
+               my @temp = grep m{(?:^|/)\Q$version\E$}, keys %found_versions;
                delete $found_versions{$_} for @temp;
                $found_removed{$_} = 1 for @temp;
            }
@@ -2319,6 +2319,17 @@ sub __calculate_merge_status{
            @{$merge_status{"${_}_versions"}}{@{$data->{"${_}_versions"}}} = (1) x @{$data->{"${_}_versions"}};
        }
     }
+    # if there is a non-source qualified version with a corresponding
+    # source qualified version, we only want to merge the source
+    # qualified version(s)
+    for (qw(fixed found)) {
+       my @unqualified_versions = grep {m{/}?0:1} keys %{$merge_status{"${_}_versions"}};
+       for my $unqualified_version (@unqualified_versions) {
+           if (grep {m{/\Q$unqualified_version\E}} keys %{$merge_status{"${_}_versions"}}) {
+               delete $merge_status{"${_}_versions"}{$unqualified_version};
+           }
+       }
+    }
     return (\%merge_status,$bugs_to_merge);
 }