Index | Thread | Search

From:
Marc Espie <marc.espie.openbsd@gmail.com>
Subject:
update-plist -x patch
To:
ports@openbsd.org, edd@openbsd.org
Date:
Thu, 2 Jul 2026 11:56:58 +0200

Download raw body.

Thread
Working on making texlive work correctly with update-plist

This is a first option (disregard -h/-H which are placeholders for now)

Namely, it allows -x pkgpath as a parameter to update-plist
to make it ignore all paths from a pkgpath


(if people want to know the gory details, look into 
/usr/ports/print/texlive/texmf/files/update_plist_hints.py
which has a large set of files hardcoded to be ignored, as they are all
parts of some other packages... with this option, this part of
update_plist_hints.py can die)

Index: update-plist
===================================================================
RCS file: /build/data/openbsd/cvs/ports/infrastructure/bin/update-plist,v
diff -u -p -r1.216 update-plist
--- update-plist	18 Jan 2026 10:02:28 -0000	1.216
+++ update-plist	2 Jul 2026 09:53:26 -0000
@@ -307,6 +307,10 @@ sub write_conflict_info($self, $fh)
 sub is_part_of_conflict_info($)
 { 0 }
 
+sub exclude_files($, $, $)
+{
+}
+
 package OpenBSD::PackingElement::State;
 
 # that stuff NEVER gets copied over, but interpolated from existing objects
@@ -648,6 +652,11 @@ sub show_unknown($self)
 	}
 }
 
+sub exclude_files($self, $state, $base)
+{
+	$state->{ignored}{$base.'/'.$self->fullname} = 1;
+}
+
 package OpenBSD::PackingElement::FileBase;
 sub bookmark($self, $plist)
 {
@@ -859,12 +868,21 @@ sub handle_options($state)
 		'V' => sub($var) {
 			push(@{$state->{no_version}}, $var);
 		    },
+		'x' => sub($pkgpath) {
+			$state->exclude_pkgpath($pkgpath);
+		    },
+		'h' => sub($h) {
+			$state->read_hints_file($h, 0);
+		    },
+		'H' => sub($h) {
+			$state->read_hints_file($h, 1);
+		    },
 
 	};
-	$state->SUPER::handle_options('OrvI:c:qV:fFC:i:j:L:s:S:X:P:w:e:E:H:', 
-	    '[-FfmnOrvx] [-C dir] [-c comment] [-E ext] [-e ext] [-H hints]',
+	$state->SUPER::handle_options('OrvI:c:qV:fFC:i:j:L:s:S:X:x:P:w:e:E:H:h:', 
+	    '[-FfmnOrvx] [-C dir] [-c comment] [-E ext] [-e ext] [-[Hh] hints]',
 	    '[-i var] [-I ignored] [-j jobs] [-L logfile] [-P pkgdir]',
-	    '[-S var] [-s var] [-V var] [-w suffix] [-X path]',
+	    '[-S var] [-s var] [-V var] [-w suffix] [-X path] [-x pkgpath]',
 	    '-- pkg_create_args ...');
     	$state->{pkgdir} = $state->opt('P');
 	$state->{scan_as_root} = $state->opt('r');
@@ -886,6 +904,19 @@ sub handle_options($state)
 	}
 }
 
+sub exclude_pkgpath($state, $pkgpath)
+{
+	my $plist = OpenBSD::Dependencies::CreateSolver->ask_tree($state,
+	    $pkgpath, $ENV{'PORTSDIR'}, \&OpenBSD::PackingList::FilesOnly,
+	    'print-plist');
+	if (!defined $plist) {
+		$state->fatal("Can't read plist for #1", $pkgpath);
+	}
+	# XXX this is delayed because we need to know WORKINST, and we
+	# only get this from subpackage options
+	push(@{$state->{excluded_plists}}, $plist);
+}
+
 sub parse_hints_file($state, $fname)
 {
 	open(my $f, '<', $fname) or 
@@ -1377,8 +1408,18 @@ sub try_pkglocate($self)
 	}
 }
 
+sub ignore_excluded_plists($self, $base)
+{
+	my $state = $self->{state};
+	for my $plist (@{$state->{excluded_plists}}) {
+		$plist->exclude_files($state, $base);
+	}
+	delete $state->{excluded_plists};
+}
+
 my $self = UpdatePlist->new;
 my $base = OpenBSD::UpdatePlistFactory->parse_args($self);
+$self->ignore_excluded_plists($base);
 $self->known_objects;
 $self->scan_fake_dir($base);
 $self->zap_debug_files;