[pacman-dev] [PATCH] makepkg.sh.in: fix a GNU-ism in su invocation

Rémy Oudompheng remyoudompheng at gmail.com
Tue Apr 12 15:30:19 EDT 2011

GNU su supports the -c option to specify a command to execute.
However, other flavours of su may have a different interpretation
of the '-c' flag (e.g. FreeBSD and OpenBSD).

The behaviour is correct when '-c' follows an explicit username.

Signed-off-by: Rémy Oudompheng <remy at archlinux.org>
See for example:
* OpenBSD manpage at
* FreeBSD manpage at

On branch 'maint'

 scripts/makepkg.sh.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 1c8c50e..69922c9 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -394,7 +394,7 @@ run_pacman() {
 		if [ "$(type -p sudo)" ]; then
 			cmd="sudo $cmd"
-			cmd="su -c '$cmd'"
+			cmd="su root -c '$cmd'"
 	eval "$cmd"

More information about the pacman-dev mailing list