summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2013-12-30 09:01:31 +0000
committerMarc Espie <espie@cvs.openbsd.org>2013-12-30 09:01:31 +0000
commitc3274ef8063f3686a36a78abae3e1a6bb16668cf (patch)
tree22547472019c92ab98136c06a07e343718dd9c97 /usr.sbin
parent6c22e94daba840ccd63466b57b2b578b39f01668 (diff)
explicitly fix the PATH to something sensible
move "replacing" to a method, so that it can be more specific later.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/AddDelete.pm17
1 files changed, 16 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm
index 8022e55471c..6ab0cdd9b9c 100644
--- a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm
+++ b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: AddDelete.pm,v 1.58 2013/12/25 15:59:51 espie Exp $
+# $OpenBSD: AddDelete.pm,v 1.59 2013/12/30 09:01:30 espie Exp $
#
# Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org>
#
@@ -182,6 +182,15 @@ sub handle_options
$state->{interactive} = -t STDIN;
}
$state->{localbase} = $state->opt('L') // OpenBSD::Paths->localbase;
+ $ENV{PATH} = join(':',
+ '/bin',
+ '/sbin',
+ '/usr/bin',
+ '/usr/sbin',
+ '/usr/X11R6/bin',
+ "$state->{localbase}/bin",
+ "$state->{localbase}/sbin");
+
$state->{size_only} = $state->opt('s');
$state->{quick} = $state->opt('q') || $state->config->istrue("nochecksum");
$state->{extra} = $state->opt('c');
@@ -386,6 +395,12 @@ sub status
return $self->{status};
}
+sub replacing
+{
+ my $self = shift;
+ return $self->{replacing};
+}
+
OpenBSD::Auto::cache(ldconfig,
sub {
my $self = shift;