summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2006-11-12 16:21:29 +0000
committerMarc Espie <espie@cvs.openbsd.org>2006-11-12 16:21:29 +0000
commit234ff7d359b5d643291a5bdf05ed17c0ae0e4b40 (patch)
tree4b52e98f70bb209e76ef26ae7cac2206b7612fb9 /usr.sbin
parent65097e66a2f75e0b1acc9112732092b0b3659308 (diff)
completely uniform setup
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/pkg_mklocatedb19
1 files changed, 17 insertions, 2 deletions
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";
}
}
}