]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/Control.pm
We should only delete a version in found if it's not already a fully qualified source...
[debbugs.git] / Debbugs / Control.pm
index 39e6648bbe8478aea8e28b07e454007f0c8f4e3d..5739734b06f24f623ff6ddfc37391451c226fcdf 100644 (file)
@@ -1578,7 +1578,11 @@ sub set_found {
                if (not @svers) {
                    @svers = $version;
                }
-               else {
+               elsif (not grep {$version eq $_} @svers) {
+                    # The $version was not equal to one of the source
+                    # versions, so it's probably unqualified (or just
+                    # wrong). Delete it, and use the source versions
+                    # instead.
                    if (exists $found_versions{$version}) {
                        delete $found_versions{$version};
                        $found_removed{$version} = 1;
@@ -1591,7 +1595,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 +1619,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;
            }