configurable builds

This commit is contained in:
Jim Paris 2013-08-18 21:29:01 -04:00
parent c178d25479
commit bdd76bfe0b
3 changed files with 10 additions and 3 deletions

1
config
View File

@ -1 +0,0 @@
config-12.10

8
config Normal file
View File

@ -0,0 +1,8 @@
#!/bin/bash
if [ -z "$BUILD_CONFIG" ] ; then
echo "Set BUILD_CONFIG first"
exit 1
fi
. config-$BUILD_CONFIG

View File

@ -3,7 +3,7 @@
# make sure this was run as root # make sure this was run as root
if [ $UID -ne 0 ] ; then if [ $UID -ne 0 ] ; then
echo "Need to be root; trying sudo" echo "Need to be root; trying sudo"
exec sudo $0 "$@" exec sudo env BUILD_CONFIG=$BUILD_CONFIG $0 "$@"
fi fi
# enter the chroot and run the command (if supplied) or a shell # enter the chroot and run the command (if supplied) or a shell

View File

@ -4,7 +4,7 @@
# passwords during execution # passwords during execution
if [ $UID -ne 0 ] ; then if [ $UID -ne 0 ] ; then
echo "Need to be root; trying sudo" echo "Need to be root; trying sudo"
exec sudo nice $0 "$@" exec sudo nice env BUILD_CONFIG=$BUILD_CONFIG $0 "$@"
fi fi
. config || exit 0 . config || exit 0