This should allow zapping $OpenBSD$ lines in plists without any negative
side-effects.


Index: register-plist
===================================================================
RCS file: /cvs/ports/infrastructure/bin/register-plist,v
retrieving revision 1.28
diff -u -p -r1.28 register-plist
--- register-plist      6 Oct 2021 13:56:50 -0000       1.28
+++ register-plist      28 Feb 2022 13:14:09 -0000
@@ -138,6 +138,12 @@ sub save_stuff
 {
 }
 
+# to be used for stuff that we no longer want
+sub may_vanish
+{
+       0
+}
+
 package OpenBSD::PackingElement::Manpage;
 sub save_stuff
 {
@@ -345,6 +351,11 @@ package OpenBSD::PackingElement::CVSTag;
 
 our $openbsd = 'OpenBSD';
 
+sub may_vanish
+{
+       1
+}
+
 sub forget_details
 {
        my $self = shift;
@@ -513,6 +524,15 @@ sub my_compare
                my $e2 = shift @$l2;
                if (!defined $e2) {
                        return combine(Result::Different, $seen_stop);
+               }
+               # zap stuff that's no longer relevant, unless it's still
+               # there and we want to keep it identical
+               if ($e2->may_vanish && ref($e) ne ref($e2)) {
+                       $e2 = shift @$l2;
+                       if (!defined $e2) {
+                               return combine(Result::Different, $seen_stop);
+                       }
+                       $seen_stop = combine(Result::Updatable, $seen_stop);
                }
                my $r = $e->compare($e2);
                if ($r == Result::Different) {

Reply via email to