Mailinglist Archive: opensuse-packaging (60 mails)

< Previous Next >
[opensuse-packaging] [PATCH] default to non-root
  • From: Jan Engelhardt <jengelh@xxxxxxxxxxxxxxx>
  • Date: Fri, 19 Jan 2007 19:48:40 +0100 (MET)
  • Message-id: <Pine.LNX.4.61.0701191947520.18606@xxxxxxxxxxxxxxx>

Default to non-root builds and recognize "rootforbuild" in specfiles.

Signed-off-by: Jan Engelhardt <jengelh@xxxxxx>

Index: build/build
===================================================================
--- build.orig/build
+++ build/build
@@ -46,7 +46,8 @@ RUNNING_IN_XEN=
RPMLIST=
RELEASE=
REASON=
-NOROOTFORBUILD=
+NOROOTFORBUILD=true
+ROOTFORBUILD=false
LOGFILE=
BUILD_DIR=${BUILD_DIR:-/usr/lib/build}
KILL=
@@ -711,7 +712,12 @@ while test -n "$1"; do
;;
*-norootforbuild)
NOROOTFORBUILD=true
- ;;
+ ROOTFORBUILD=false
+ ;;
+ (*-rootforbuild)
+ NOROOTFORBUILD=false
+ ROOTFORBUILD=true
+ ;;
*-stage)
BUILD_RPM_BUILD_STAGE="$ARG"
shift
@@ -1008,6 +1014,7 @@ for SPECFILE in $SPECFILES ; do
echo "BUILD_DIST='${BUILD_DIST//\'/$Q}'" >> $BUILD_ROOT/.build/build.data
echo "RELEASE='${RELEASE//\'/$Q}'" >> $BUILD_ROOT/.build/build.data
echo "NOROOTFORBUILD='${NOROOTFORBUILD//\'/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "ROOTFORBUILD='${ROOTFORBUILD//\'/$Q}'" >> $BUILD_ROOT/.build/build.data
echo "CREATE_BASELIBS='$CREATE_BASELIBS'" >> $BUILD_ROOT/.build/build.data
echo "REASON='${REASON//\'/$Q}'" >> $BUILD_ROOT/.build/build.data
test -n "$XENSWAP" && echo "XENSWAP='/dev/hda2'" >> $BUILD_ROOT/.build/build.data
@@ -1103,12 +1110,16 @@ for SPECFILE in $SPECFILES ; do
#
# check if we want to build with the abuild user
#
- BUILD_USER=root
- test -n "$NOROOTFORBUILD" && BUILD_USER=abuild
+ BUILD_USER=abuild
+ test -z "$ROOTFORBUILD" && BUILD_USER=abuild
if test "$SPECFILE" != "${SPECFILE%.dsc}" \
|| egrep '^#[ ]*norootforbuild[ ]*$' >/dev/null <$SPECFILE; then
BUILD_USER=abuild
fi
+ if test "$SPECFILE" != "${SPECFILE%.dsc}" \
+ || egrep '^#[ ]*rootforbuild[ ]*$' >/dev/null <$SPECFILE; then
+ BUILD_USER="root"
+ fi
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
#<EOF>

-`J'
--
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages