From 78994b520f895dc3d4eb21d59b10407befc0512d Mon Sep 17 00:00:00 2001 From: rhatto Date: Sun, 25 Jan 2009 00:17:15 +0000 Subject: attempt to fix #55 git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@774 04377dda-e619-0410-9926-eae83683ac58 --- trunk/src/createpkg | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/trunk/src/createpkg b/trunk/src/createpkg index bbb0a4b..fdd855e 100644 --- a/trunk/src/createpkg +++ b/trunk/src/createpkg @@ -727,6 +727,20 @@ eecho $messag "$BASENAME: processing $SCRIPT_NAME" # Change to script base directory cd $SCRIPT_BASE +# Use fakeroot if needed and available +if [ "`whoami`" != "root" ]; then + FAKEROOT="`which fakeroot`" + if [ "$?" == "0" ]; then + FAKEROOT="$FAKEROOT --" + else + eecho $messag "$BASENAME: WARNING: not running as root and no fakeroot found." + eecho $messag "$BASENAME: WARNING: your build might not be successful." + FAKEROOT="" + fi +else + FAKEROOT="" +fi + # Run SlackBuild script [ $DEBUG -eq $off ] && SHELL_FLAG="+x" || SHELL_FLAG="-x" ( @@ -738,7 +752,7 @@ cd $SCRIPT_BASE COLOR=${COLOR:=$COLOR_MODE} \ REPOS=${REPOS:=$PACKAGES_DIR} \ CLEANUP=${CLEANUP:=$CREATEPKG_CLEANUP} \ - INTERACT=no sh $SHELL_FLAG ./$SCRIPT_NAME + INTERACT=no $FAKEROOT sh $SHELL_FLAG ./$SCRIPT_NAME ) # Check if package was built -- cgit v1.2.3