From: Dr. Peter Poeml Date: Wed, 21 Mar 2007 00:27:26 +0000 (+0000) Subject: make needsrootforbuild / norootforbuild work X-Git-Tag: obs_2.0~446 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9308e3609fdc903a6cbad9e5f4afd55cb31d2fe;p=tools%2Fobs-build.git make needsrootforbuild / norootforbuild work --- diff --git a/build b/build index bf1ab9b..7859ee9 100755 --- a/build +++ b/build @@ -646,14 +646,17 @@ for SPECFILE in $SPECFILES ; do # # check if we want to build with the abuild user + # build as root per default, unless option --norootforbuild was given + # override with "needsrootforbuild" or "norootforbuild" in the spec file # BUILD_USER=root + test -n "$NOROOTFORBUILD" && BUILD_USER=abuild if test "$BUILD_USER" = abuild ; then egrep '^#[ ]*needsrootforbuild[ ]*$' >/dev/null <$SPECFILE && BUILD_USER=root else egrep '^#[ ]*norootforbuild[ ]*$' >/dev/null <$SPECFILE && BUILD_USER=abuild fi - test -n "$NOROOTFORBUILD" && BUILD_USER=abuild + if test $BUILD_USER = abuild ; then if ! egrep '^abuild:' >/dev/null <$BUILD_ROOT/etc/passwd ; then echo 'abuild::99:99:Autobuild:/home/abuild:/bin/bash' >>$BUILD_ROOT/etc/passwd