summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2014-07-13 15:54:29 +0000
committerMarc Espie <espie@cvs.openbsd.org>2014-07-13 15:54:29 +0000
commit306d07b2fa87c0a137e667673e4558faa431cdc9 (patch)
tree757a225a5e354b0a7063b48d71278be8edfffd3b
parent9a5fd7449d7b77242e1885e4aef5c37ee696abb7 (diff)
stuff no longer needed, now that base/x release install its own locate dbs
-rw-r--r--usr.sbin/pkg_add/pkg_mklocatedb91
-rw-r--r--usr.sbin/pkg_add/pkg_mklocatedb.140
2 files changed, 7 insertions, 124 deletions
diff --git a/usr.sbin/pkg_add/pkg_mklocatedb b/usr.sbin/pkg_add/pkg_mklocatedb
index 5440d8bb3af..84d67b96939 100644
--- a/usr.sbin/pkg_add/pkg_mklocatedb
+++ b/usr.sbin/pkg_add/pkg_mklocatedb
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# Copyright (c) 2005-2010 Marc Espie <espie@openbsd.org>
-# $OpenBSD: pkg_mklocatedb,v 1.42 2014/04/14 20:40:41 espie Exp $
+# $OpenBSD: pkg_mklocatedb,v 1.43 2014/07/13 15:54:28 espie Exp $
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
@@ -31,63 +31,16 @@ sub handle_options
{
my $state = shift;
$state->{no_exports} = 1;
- $state->SUPER::handle_options('aCd:Knqs:x:X:r:p:Pu',
- '[-aCKnPqu] [-d repository] [-p portsdir] [-r release] [-s src] ',
- '[-X X11src] [pkg-name [...]]');
- $state->{srcdir} = $state->opt('s');
- $state->{xdir} = $state->opt('X') // $state->opt('x');
- $state->{releasedir} = $state->opt('r');
+ $state->SUPER::handle_options('ad:Knqp:Pu',
+ '[-aKnPqu] [-d repository] [-p portsdir] [pkg-name ...]');
$state->{portsdir} = $state->opt('p');
$state->{pkgdir} = $state->opt('d');
$state->{quiet} = $state->opt('q');
$state->{pkgpath} = $state->opt('P');
$state->{allinfo} = $state->opt('a');
$state->{nopipe} = $state->opt('n');
- $state->{check} = $state->opt('C');
$state->{full} = $state->opt('K');
$state->{update} = $state->opt('u');
- if ($state->{check}) {
- unless ($state->{srcdir} or $state->{portsdir}) {
- $state->usage("-C without -s dir or -x dir");
- }
- }
-}
-
-sub build_tag
-{
- my ($state, $dir, $set, $rev) = @_;
- my $r;
- if ($state->{allinfo}) {
- $r = "$dir/$set:$set$rev";
- } elsif ($state->{pkgpath}) {
- $r = "$dir/$set";
- } else {
- $r = "$set$rev";
- }
- $state->errsay($r) unless $state->{quiet};
- $state->{current_set} = $set;
- $state->{current_tag} = $r;
-}
-
-sub process_entry
-{
- my ($state, $e) = @_;
- if ($state->{check} && !-e $e) {
- $state->sync_error($e);
- }
- print {$state->{out}} "$state->{current_tag}:$e\n";
-}
-
-sub sync_error
-{
- my ($state, $e) = @_;
- my $set = $state->{current_set};
- if ($set =~ m/etc/) {
- $state->errsay("Couldn't find #1 from set #2:\n\tDid you run sysmerge recently ?", $e, $set);
- } else {
- $state->errsay("Couldn't find #1 from set #2:\n\tsrc and installation out of synch ?", $e, $set);
- $state->{fatals}++;
- }
}
package OpenBSD::PackingElement;
@@ -173,32 +126,6 @@ sub open_output
}
}
-sub do_release
-{
- my $state = shift;
-
- require OpenBSD::Ustar;
-
- opendir(my $dir, $state->{releasedir}) or return;
- while (my $e = readdir $dir) {
- if ($e =~ m/^(\w+\d\d)\.tgz$/o) {
- my $set = $1;
- open my $arc, '-|', OpenBSD::Paths->gzip, '-c', '-d',
- "--", $state->{releasedir}."/".$e or
- $state->fatal("couldn't open pipe from gzip: #1", $!);
-
- my $u = OpenBSD::Ustar->new($arc, $state, '/');
- while (my $f = $u->next) {
- my $name = $f->{name};
- $name =~ s/^\.//o;
- print {$state->{out}} "$set:$name\n";
- }
- close $arc;
- }
- }
- closedir($dir);
-}
-
sub print_out
{
my ($plist, $state) = @_;
@@ -269,22 +196,10 @@ $state->handle_options;
open_output($state);
-if ($state->{srcdir}) {
- require OpenBSD::SetList;
- OpenBSD::SetList::Source->walk($state, $state->{srcdir});
-}
-if ($state->{xdir}) {
- require OpenBSD::SetList;
- OpenBSD::SetList::Xenocara->walk($state, $state->{xdir});
-}
if ($state->{fatals}) {
$state->fatal("Files not found, can't continue");
}
-if ($state->{releasedir}) {
- do_release($state);
-}
-
if ($state->{portsdir}) {
do_portsdir($state);
} elsif ($state->{pkgdir}) {
diff --git a/usr.sbin/pkg_add/pkg_mklocatedb.1 b/usr.sbin/pkg_add/pkg_mklocatedb.1
index fc6f3d196b8..9b9b39f751d 100644
--- a/usr.sbin/pkg_add/pkg_mklocatedb.1
+++ b/usr.sbin/pkg_add/pkg_mklocatedb.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pkg_mklocatedb.1,v 1.16 2014/04/14 20:40:41 espie Exp $
+.\" $OpenBSD: pkg_mklocatedb.1,v 1.17 2014/07/13 15:54:28 espie Exp $
.\" Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
@@ -13,7 +13,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: April 14 2014 $
+.Dd $Mdocdate: July 13 2014 $
.Dt PKG_MKLOCATEDB 1
.Os
.Sh NAME
@@ -22,13 +22,10 @@
.Sh SYNOPSIS
.Nm pkg_mklocatedb
.Bk -words
-.Op Fl aCKnPqu
+.Op Fl aKnPqu
.Op Fl d Ar repository
.Op Fl p Ar portsdir
-.Op Fl r Ar release
-.Op Fl s Ar src
-.Op Fl X Ar X11src
-.Op Ar pkg-name Op Ar ...
+.Op Ar pkg-name ...
.Ek
.Sh DESCRIPTION
The
@@ -79,19 +76,10 @@ the list of names is fed to
.Pa /usr/libexec/locate.mklocatedb
and the end result should be redirected to a file.
.Pp
-In addition,
-.Nm
-can also list files in the base sets of an
-.Ox
-distribution, which are not exactly packages in the usual sense.
-.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl a
Prepend file names with pkgpath information and package names.
-.It Fl C
-Check that files from the source and xenocara sets actually exist.
-This prevents badly out-of-synch errors.
.It Fl d Ar repository
Scan directory
.Ar repository
@@ -111,30 +99,10 @@ Prepend file names with pkgpath information instead of package name.
Retrieve packing-lists from the ports tree instead of binary packages.
.It Fl q
Be quiet: do not report every package processed to standard error.
-.It Fl r Ar release
-Specify the location of a release directory
-.Po
-see
-.Xr release 8
-.Pc .
-.Nm
-will list release tar balls from that directory.
-.It Fl s Ar src
-Specify the location of
-.Ox
-source.
-.Nm
-will list sets found under that source directory.
.It Fl u
Update an existing list.
The list must come from standard input, and contain pkgpath information
for items to be replaced.
-This can also be used to supplement an existing database with source and
-x11 information.
-.It Fl X Ar X11src
-Specify the location of X11 source.
-.Nm
-will list sets found under that X11 source directory.
.El
.Sh SEE ALSO
.Xr locate 1 ,