kiss: drop root when running git if needed
This commit is contained in:
parent
7493ccb17b
commit
d61986721d
11
kiss
11
kiss
|
@ -71,7 +71,7 @@ dosu() {
|
||||||
# command allows you to input a password via stdin. To hide
|
# command allows you to input a password via stdin. To hide
|
||||||
# the prompt, the command's output is sent to '/dev/tty'
|
# the prompt, the command's output is sent to '/dev/tty'
|
||||||
# and the output of 'su' is sent to '/dev/null'.
|
# and the output of 'su' is sent to '/dev/null'.
|
||||||
echo "$pass" | su -c "$* >/dev/tty" >/dev/null
|
echo "$pass" | su "${drop_to:-root}" -c "$* >/dev/tty" >/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_lint() {
|
pkg_lint() {
|
||||||
|
@ -912,9 +912,16 @@ pkg_updates() {
|
||||||
if [ -w "$PWD" ]; then
|
if [ -w "$PWD" ]; then
|
||||||
git fetch
|
git fetch
|
||||||
git merge
|
git merge
|
||||||
|
|
||||||
else
|
else
|
||||||
|
log "$PWD" "Need root to update"
|
||||||
|
|
||||||
|
# Find out the owner of the repository and spawn
|
||||||
|
# git as this user below.
|
||||||
|
(drop_to=$(stat -c %U "$PWD")
|
||||||
|
|
||||||
dosu git fetch
|
dosu git fetch
|
||||||
dosu git merge
|
dosu git merge)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue