summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-01-31 17:56:14 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-01-31 17:56:14 +0000
commit48adc9f8a226334818caed8cd55551f81dde11e9 (patch)
tree92827776ed6cebc190ed276349a4b6b26b08bc05 /usr.sbin/pkg_add
parent845389c5a5555d742906157731524287ca16e8ed (diff)
pkg_create -L support, which I forgot to commit.
-B pkg-destdir, synonymous to -S, and PKG_DESTDIR support.
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/pkg_create21
-rw-r--r--usr.sbin/pkg_add/pkg_create.123
2 files changed, 36 insertions, 8 deletions
diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create
index 46badd42c1c..d5b60a391fa 100644
--- a/usr.sbin/pkg_add/pkg_create
+++ b/usr.sbin/pkg_add/pkg_create
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_create,v 1.7 2004/01/27 00:13:04 espie Exp $
+# $OpenBSD: pkg_create,v 1.8 2004/01/31 17:56:13 espie Exp $
#
# Copyright (c) 2003 Marc Espie.
#
@@ -129,8 +129,9 @@ package main;
our $errors = 0;
our ($opt_p, $opt_f, $opt_c, $opt_d, $opt_v, $opt_i, $opt_k, $opt_r, $opt_D,
- $opt_S, $opt_m, $opt_h, $opt_s, $opt_O, $opt_P, $opt_C, $opt_A);
-getopts('p:f:c:d:vi:k:r:D:S:m:hs:OP:C:A:');
+ $opt_S, $opt_m, $opt_h, $opt_s, $opt_O, $opt_P, $opt_C, $opt_A, $opt_L,
+ $opt_B);
+getopts('p:f:c:d:vi:k:r:D:S:m:hs:OP:C:A:L:B:');
if (@ARGV != 1) {
die "Exactly one single package name is required";
@@ -209,10 +210,22 @@ if (defined $opt_A) {
OpenBSD::PackingElement::Arch->add($plist, $opt_A);
}
+if (defined $opt_L) {
+ OpenBSD::PackingElement::LocalBase->add($plist, $opt_L);
+}
+
$plist->fromfile($dir.CONTENTS) or die "Can't open packing list";
-my $base = $opt_S || '/';
+my $base = '/';
+if (defined $opt_B) {
+ $base = $opt_B;
+} elsif (defined $opt_S) {
+ $base = $opt_S;
+} elsif (defined $ENV{'PKG_PREFIX'}) {
+ $base = $ENV{'PKG_PREFIX'};
+}
+
$plist->makesum($base);
$plist->avert_duplicates();
if ($errors) {
diff --git a/usr.sbin/pkg_add/pkg_create.1 b/usr.sbin/pkg_add/pkg_create.1
index 9c739c063e2..e4dc32859a4 100644
--- a/usr.sbin/pkg_add/pkg_create.1
+++ b/usr.sbin/pkg_add/pkg_create.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pkg_create.1,v 1.4 2004/01/28 22:12:01 espie Exp $
+.\" $OpenBSD: pkg_create.1,v 1.5 2004/01/31 17:56:13 espie Exp $
.\"
.\" FreeBSD install - a package for the installation and maintenance
.\" of non-core utilities.
@@ -35,13 +35,14 @@
.Bk -words
.Op Fl hv
.Op Fl A Ar arches
+.Op Fl B Ar pkg-destdir
.Op Fl P Ar dpkgs
.Op Fl C Ar cpkgs
.Op Fl p Ar prefix
.Op Fl i Ar iscript
.Op Fl k Ar dscript
.Op Fl r Ar rscript
-.Op Fl S Ar fake-base
+.Op Fl S Ar pkg-destdir
.Op Fl D Ar displayfile
.Op Fl L Ar localbase
.Fl c Ar comment
@@ -127,10 +128,13 @@ as the initial directory
.Dq base
to start from in selecting files for
the package, and to record as the base for installing the package.
-.It Fl S Ar fake-base
+.It Fl S Ar pkg-destdir
+.It Fl B Ar pkg-destdir
Set
-.Ar fake-base
+.Ar pkg-destdir
as the prefix to prepend to any file to select for the package.
+Prefer
+.Fl B .
.It Fl L Ar localbase
Record
.Ar localbase
@@ -366,6 +370,17 @@ With this option, the older package version will still be noticed, but the
installation will proceed anyway.
.El
.El
+.Sh ENVIRONMENT
+.Bl -tag -width PKG_DESTDIR
+.It Ev PKG_DESTDIR
+Default value for
+.Ar pkg-destdir ,
+if no
+.Fl B
+or
+.Fl S
+option is specified.
+.El
.Sh SEE ALSO
.Xr pkg_add 1 ,
.Xr pkg_delete 1 ,