__package_pip: always use su for runas parameter.

This commit is contained in:
Darko Poljak 2016-04-21 08:24:47 +02:00
parent f24d264480
commit 66c2e16a24
1 changed files with 5 additions and 6 deletions

View File

@ -45,24 +45,23 @@ runasparam="$__object/parameter/runas"
if [ -f "$runasparam" ]
then
runas=$(cat "$runasparam")
runas_cmd=$(cat "$__global/explorer/sucmd")
else
runas_cmd=""
runas=""
fi
case "$state_should" in
present)
if [ "$runas_cmd" ]
if [ "$runas" ]
then
echo "$runas_cmd $runas \"$pip install -q $name\""
echo "su -c \"$pip install -q $name\" $runas"
else
echo $pip install -q "$name"
fi
;;
absent)
if [ "$runas_cmd" ]
if [ "$runas" ]
then
echo "$runas_cmd $runas \"$pip uninstall -q -y $name\""
echo "su -c \"$pip uninstall -q -y $name\" $runas"
else
echo $pip uninstall -q -y "$name"
fi