diff options
| author | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2009-01-25 00:17:15 +0000 | 
|---|---|---|
| committer | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2009-01-25 00:17:15 +0000 | 
| commit | 78994b520f895dc3d4eb21d59b10407befc0512d (patch) | |
| tree | 031f9eb5da8dad135872060b1af14306a536c3d5 | |
| parent | 902867b15281779f09a348fb3b7e5aab754a20c2 (diff) | |
| download | simplepkg-78994b520f895dc3d4eb21d59b10407befc0512d.tar.gz simplepkg-78994b520f895dc3d4eb21d59b10407befc0512d.tar.bz2  | |
attempt to fix #55
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@774 04377dda-e619-0410-9926-eae83683ac58
| -rw-r--r-- | trunk/src/createpkg | 16 | 
1 files changed, 15 insertions, 1 deletions
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  | 
