SVN: toys/tools/cleanbuild/cleanbuild

sparky sparky at pld-linux.org
Wed Mar 24 00:16:47 CET 2010


Author: sparky
Date: Wed Mar 24 00:16:43 2010
New Revision: 11285

Modified:
   toys/tools/cleanbuild/cleanbuild
Log:
- replace $(getent passwd $USER | cut -d: -f3) with much simpler $(id $USER -u)
- allow setting additional rpmmacros in .cleanbuildrc


Modified: toys/tools/cleanbuild/cleanbuild
==============================================================================
--- toys/tools/cleanbuild/cleanbuild	(original)
+++ toys/tools/cleanbuild/cleanbuild	Wed Mar 24 00:16:43 2010
@@ -5,6 +5,8 @@
 SRC="-n th-x86_64-test"
 SUFFIX=""
 CACHEDIR="$PWD/poldekcache"
+RPMMACROS=""
+BUILDERRC=""
 IGNORE=""
 ignore() { IGNORE="$IGNORE $*"; }
 NODEBUG=true
@@ -279,7 +281,7 @@
 		mount -o bind /$DIR $CHDIR/$DIR
 	done
 
-	chroot $CHDIR useradd -m $USER -u$(getent passwd $USER | cut -d: -f3)
+	chroot $CHDIR useradd -m $USER -u$(id $USER -u)
 
 	# replicate files which already belong to $USER
 	# so they will have correct owner and permissions
@@ -294,13 +296,15 @@
 	%_rpmdir		%{expand:%%global _rpmdir %([ -d %{_topdir}/../%{_rpmdirname} ] && (cd %{_topdir}/../%{_rpmdirname}; pwd) || echo %{_topdir}/%{_rpmdirname})}%_rpmdir
 	%distribution	CleanPLD
 	%_binary_payload	w1.gzdio
-	#%_smp_mflags	-j4
 EOM
+	[ -z "$RPMMACROS" ] || echo "$RPMMACROS" >> $CHDIR/$CHHOME/.rpmmacros
 
 	cp -a $CHDIR/$CHHOME/{.bashrc,.builderrc}
 	cat <<-'EORC' > $CHDIR/$CHHOME/.builderrc
 	TITLECHANGE=no
 EORC
+	[ -z "$BUILDERRC" ] || echo "$BUILDERRC" >> $CHDIR/$CHHOME/.builderrc
+
 	set +e
 }
 


More information about the pld-cvs-commit mailing list