Commit 7b225cb2 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm: modify PATH only for subprocess

parent 3c6a3311
...@@ -57,8 +57,6 @@ load_helper() ...@@ -57,8 +57,6 @@ load_helper()
load_helper epm-sh-functions load_helper epm-sh-functions
#PATH=$PATH:/sbin:/usr/sbin
set_pm_type set_pm_type
check_tty check_tty
......
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
__check_command_in_path() __check_command_in_path()
{ {
PATH=$PATH:/sbin:/usr/sbin print_command_path "$1" # with hack for sudo case
( PATH=$PATH:/sbin:/usr/sbin print_command_path "$1" )
} }
# returns TRUE if package version is omitted, or package is not installed, or version is too old # returns TRUE if package version is omitted, or package is not installed, or version is too old
......
...@@ -42,13 +42,11 @@ __epm_pack() ...@@ -42,13 +42,11 @@ __epm_pack()
set_sudo set_sudo
export SUDO export SUDO
# TODO: inside () ? [ "$PROGDIR" = "/usr/bin" ] && SCPATH="$PATH" || SCPATH="$PROGDIR:$PATH"
export PATH=$PROGDIR:$PATH
local bashopt='' local bashopt=''
[ -n "$verbose" ] && bashopt='-x' [ -n "$verbose" ] && bashopt='-x'
#info "Running $($script --description 2>/dev/null) ..." #info "Running $($script --description 2>/dev/null) ..."
( unset EPMCURDIR ; docmd $CMDSHELL $bashopt $repackcode "$tarname" "$filefortarname" "$packversion" ) || fatal ( unset EPMCURDIR ; export PATH=$SCPATH ;docmd $CMDSHELL $bashopt $repackcode "$tarname" "$filefortarname" "$packversion" ) || fatal
returntarname="$(cat "$filefortarname")" || fatal "pack script $repackcode didn't set tarname" returntarname="$(cat "$filefortarname")" || fatal "pack script $repackcode didn't set tarname"
[ -s "$returntarname" ] || fatal "pack script $repackcode return unexist $returntarname file" [ -s "$returntarname" ] || fatal "pack script $repackcode return unexist $returntarname file"
......
...@@ -55,7 +55,8 @@ __run_script() ...@@ -55,7 +55,8 @@ __run_script()
[ -f "$script.rpmnew" ] && warning "There is .rpmnew file(s) in $psdir dir. The play script can be outdated." [ -f "$script.rpmnew" ] && warning "There is .rpmnew file(s) in $psdir dir. The play script can be outdated."
shift shift
( unset EPMCURDIR ; export PATH=$PROGDIR:$PATH ; $script "$@" ) [ "$PROGDIR" = "/usr/bin" ] && SCPATH="$PATH" || SCPATH="$PROGDIR:$PATH"
( unset EPMCURDIR ; export PATH=$SCPATH ; $script "$@" )
return return
} }
...@@ -145,7 +146,6 @@ __epm_play_run() ...@@ -145,7 +146,6 @@ __epm_play_run()
local script="$psdir/$1.sh" local script="$psdir/$1.sh"
shift shift
export PATH=$PROGDIR:$PATH
set_sudo set_sudo
export SUDO export SUDO
...@@ -158,7 +158,8 @@ __epm_play_run() ...@@ -158,7 +158,8 @@ __epm_play_run()
local bashopt='' local bashopt=''
[ -n "$verbose" ] && bashopt='-x' [ -n "$verbose" ] && bashopt='-x'
#info "Running $($script --description 2>/dev/null) ..." #info "Running $($script --description 2>/dev/null) ..."
docmd $CMDSHELL $bashopt $script "$@" [ "$PROGDIR" = "/usr/bin" ] && SCPATH="$PATH" || SCPATH="$PROGDIR:$PATH"
( export EPM_OPTIONS="$EPM_OPTIONS $addopt" export PATH=$SCPATH ; docmd $CMDSHELL $bashopt $script "$@" )
} }
__epm_play_list_installed() __epm_play_list_installed()
......
...@@ -82,10 +82,10 @@ __apply_fix_code() ...@@ -82,10 +82,10 @@ __apply_fix_code()
[ -f "$repackcode.rpmnew" ] && warning "There is .rpmnew file(s) in $EPM_REPACK_SCRIPTS_DIR dir. The pack script can be outdated." [ -f "$repackcode.rpmnew" ] && warning "There is .rpmnew file(s) in $EPM_REPACK_SCRIPTS_DIR dir. The pack script can be outdated."
shift shift
export PATH=$PROGDIR:$PATH [ "$PROGDIR" = "/usr/bin" ] && SCPATH="$PATH" || SCPATH="$PROGDIR:$PATH"
local bashopt='' local bashopt=''
[ -n "$verbose" ] && bashopt='-x' [ -n "$verbose" ] && bashopt='-x'
( unset EPMCURDIR ; docmd $CMDSHELL $bashopt $repackcode "$1" "$2" "$3" "$4" ) || fatal "There is an error from $repackcode script" ( unset EPMCURDIR ; export PATH=$SCPATH ; docmd $CMDSHELL $bashopt $repackcode "$1" "$2" "$3" "$4" ) || fatal "There is an error from $repackcode script"
} }
__create_rpmmacros() __create_rpmmacros()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment