From: espie Date: Mon, 30 Dec 2013 09:01:30 +0000 (+0000) Subject: explicitly fix the PATH to something sensible X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8cbfaa7dc9340eb51c13a7c733badd612f94c6b2;p=openbsd explicitly fix the PATH to something sensible move "replacing" to a method, so that it can be more specific later. --- 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 # @@ -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;