Commit 37dc464e authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play: small fixes

parent 3cc2975b
...@@ -24,6 +24,9 @@ __run_script() ...@@ -24,6 +24,9 @@ __run_script()
[ -s "$script" ] || return [ -s "$script" ] || return
[ -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.'
local bashopt=''
[ -n "$debug" ] && bashopt='-x'
shift shift
[ "$PROGDIR" = "/usr/bin" ] && SCPATH="$PATH" || SCPATH="$PROGDIR:$PATH" [ "$PROGDIR" = "/usr/bin" ] && SCPATH="$PATH" || SCPATH="$PROGDIR:$PATH"
( unset EPMCURDIR ; export PATH=$SCPATH ; $CMDSHELL $bashopt $script "$@" ) ( unset EPMCURDIR ; export PATH=$SCPATH ; $CMDSHELL $bashopt $script "$@" )
...@@ -76,7 +79,7 @@ __epm_play_run() ...@@ -76,7 +79,7 @@ __epm_play_run()
__epm_is_shell_script() __epm_is_shell_script()
{ {
local script="$1" local script="$1"
[ -x "$script" ] && rhas "$script" "\.sh$" && head -n1 "$script" | grep -q "^#!/bin/sh" [ -x "$script" ] && rhas "$script" "\.sh$" && head -n1 "$script" | grep -q "^#!/"
} }
...@@ -84,10 +87,12 @@ __epm_play_remove() ...@@ -84,10 +87,12 @@ __epm_play_remove()
{ {
local prescription local prescription
for prescription in $* ; do for prescription in $* ; do
# run shell script directly
if __epm_is_shell_script "$prescription" ; then if __epm_is_shell_script "$prescription" ; then
__epm_play_run_script $prescription --remove __epm_play_run_script $prescription --remove
continue continue
fi fi
# run play script
if __check_play_script "$prescription" ; then if __check_play_script "$prescription" ; then
__epm_play_run $prescription --remove __epm_play_run $prescription --remove
__remove_installed_app "$prescription" __remove_installed_app "$prescription"
......
...@@ -284,8 +284,9 @@ check_alternative_pkgname() ...@@ -284,8 +284,9 @@ check_alternative_pkgname()
[ -n "$BASEPKGNAME" ] || BASEPKGNAME="$PKGNAME" [ -n "$BASEPKGNAME" ] || BASEPKGNAME="$PKGNAME"
[ -n "$BASEPKGNAME" ] || return [ -n "$BASEPKGNAME" ] || return
# default: with first entry in $PEODUCTALT # default: with first entry in $PRODUCTALT
BRANCH=$(get_first $PRODUCTALT) BRANCH=$(get_first $PRODUCTALT)
[ "$BRANCH" = "''" ] && BRANCH=""
PKGNAME="$BASEPKGNAME-$BRANCH" PKGNAME="$BASEPKGNAME-$BRANCH"
# override with VERSION # override with VERSION
......
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