From 234ff7d359b5d643291a5bdf05ed17c0ae0e4b40 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sun, 12 Nov 2006 16:21:29 +0000 Subject: completely uniform setup --- usr.sbin/pkg_add/pkg_mklocatedb | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/pkg_add/pkg_mklocatedb b/usr.sbin/pkg_add/pkg_mklocatedb index 7a9ba5ab79d..ceb0a624c7d 100644 --- a/usr.sbin/pkg_add/pkg_mklocatedb +++ b/usr.sbin/pkg_add/pkg_mklocatedb @@ -50,6 +50,19 @@ sub info return $r; } +sub tag +{ + my ($dir, $set, $rev) = @_; + my $r; + if ($opt_P) { + $r = "$dir/$set"; + } else { + $r = "$set$rev"; + } + print STDERR "$r\n" unless $opt_q; + return $r; +} + try { getopts('nqs:x:r:p:P'); } catchall { @@ -71,12 +84,13 @@ if ($opt_s || $opt_x) { if ($opt_s) { my $dir = "$opt_s/distrib/sets/lists"; for my $set (qw(base comp etc game man misc)) { + my $tag = tag('src', $set, $rev); for my $f ("$dir/$set/mi", "$dir/$set/md.$arch") { open my $l, '<', $f or next; while (my $e = <$l>) { chomp $e; $e =~ s/^\.//; - print $fh "$set$rev:$e\n"; + print $fh "$tag:$e\n"; } } } @@ -84,12 +98,13 @@ if ($opt_s || $opt_x) { if ($opt_x) { my $dir = "$opt_x/distrib/sets/lists"; for my $set (qw(xbase xetc xfont xserv xshare)) { + my $tag = tag('XF4', $set, $rev); for my $f ("$dir/$set/mi", "$dir/$set/md.$arch") { open my $l, '<', $f or next; while (my $e = <$l>) { chomp $e; $e =~ s/^\.//; - print $fh "$set$rev:$e\n"; + print $fh "$tag:$e\n"; } } } -- cgit v1.2.3