test -z "$BUILD_DIR" && BUILD_DIR=/usr/lib/build
test -z "$BUILD_ROOT" && BUILD_ROOT=/var/tmp/build-root
-test -z "$BUILD_RPMS" && BUILD_RPMS=/media/dvd/suse
test -z "$BUILD_ARCH" && {
BUILD_ARCH=`uname -m`
test i686 = "$BUILD_ARCH" && BUILD_ARCH=i586
}
-export BUILD_ARCH BUILD_ROOT BUILD_RPMS BUILD_DIR
+export BUILD_ARCH BUILD_ROOT BUILD_DIR
definesnstuff=()
+repos=()
export PATH=$BUILD_DIR:$PATH
--define|--with|--without)
definesnstuff[${#definesnstuff[@]}]="$PARAM";
definesnstuff[${#definesnstuff[@]}]="$ARG";
+ shift
+ ;;
+ --repository)
+ if [ -z "$ARG" ] ; then
+ echo_help
+ cleanup_and_exit
+ fi
+ repos[${#repos[@]}]="$PARAM";
+ repos[${#repos[@]}]="$ARG";
shift
;;
----noarg)
cleanup_and_exit 1
}
+repos=("${repos[@]}" ${BUILD_RPMS//:/ /})
+: ${repos:=("/media/dvd/suse")}
+
if test -n "$KILL" ; then
test -z "$SRCDIR" || usage
if test -z "$XENIMAGE" ; then
}
for SPECFILE in $BUILD_ROOT/usr/src/packages/SPECS/*.spec ; do : ; done
fi
- init_buildsystem --list-state "${definesnstuff[@]}" $USEUSEDFORBUILD $SPECFILE $BUILD_EXTRA_PACKS
+ init_buildsystem --list-state "${definesnstuff[@]}" "${repos[@]}" $USEUSEDFORBUILD $SPECFILE $BUILD_EXTRA_PACKS
ERR=$?
rm -rf $BUILD_ROOT
cleanup_and_exit $ERR
if test -n "$XENIMAGE" ; then
# do fist stage of init_buildsystem
- echo init_buildsystem $USEUSEDFORBUILD $RPMLIST $SPECFILE $ADDITIONAL_PACKS ...
- init_buildsystem --prepare "${definesnstuff[@]}" $USEUSEDFORBUILD $RPMLIST "$MYSRCDIR/$SPECFILE" $ADDITIONAL_PACKS || cleanup_and_exit 1
+ echo init_buildsystem --prepare "${definesnstuff[@]}" "${repos[@]}" $USEUSEDFORBUILD $RPMLIST $SPECFILE $ADDITIONAL_PACKS ...
+ init_buildsystem --prepare "${definesnstuff[@]}" "${repos[@]}" $USEUSEDFORBUILD $RPMLIST "$MYSRCDIR/$SPECFILE" $ADDITIONAL_PACKS || cleanup_and_exit 1
# start up xen, rerun ourself
mkdir -p $BUILD_ROOT/.build
cp -a $BUILD_DIR/. $BUILD_ROOT/.build
echo "SPECFILE='${SPECFILE//\'/$Q}'" > $BUILD_ROOT/.build/build.data
echo "BUILD_JOBS='${BUILD_JOBS//\'/$Q}'" >> $BUILD_ROOT/.build/build.data
echo "BUILD_ARCH='${BUILD_ARCH//\'/$Q}'" >> $BUILD_ROOT/.build/build.data
- echo "BUILD_RPMS='${BUILD_RPMS//\'/$Q}'" >> $BUILD_ROOT/.build/build.data
case $BUILD_DIST in
*/*)
cp $BUILD_DIST $BUILD_ROOT/.build/build.dist
echo -n "definesnstuff=(" >> $BUILD_ROOT/.build/build.data
shellquote "${definesnstuff[@]}" >> $BUILD_ROOT/.build/build.data
echo ")" >> $BUILD_ROOT/.build/build.data
+ echo -n "repos=(" >> $BUILD_ROOT/.build/build.data
+ shellquote "${repos[@]}" >> $BUILD_ROOT/.build/build.data
+ echo ")" >> $BUILD_ROOT/.build/build.data
umount $BUILD_ROOT
XMROOT=file:$XENIMAGE
XMROOT=${XMROOT/#file:\/dev/phy:}
fi
if test "$DO_INIT" = true ; then
- echo init_buildsystem "${definesnstuff[@]}" $USEUSEDFORBUILD $RPMLIST $SPECFILE $ADDITIONAL_PACKS ...
- $BUILD_INIT_BUILDSYSTEM $USEUSEDFORBUILD $RPMLIST "$MYSRCDIR/$SPECFILE" $ADDITIONAL_PACKS || cleanup_and_exit 1
+ echo init_buildsystem "${definesnstuff[@]}" "${repos[@]}" $USEUSEDFORBUILD $RPMLIST $SPECFILE $ADDITIONAL_PACKS ...
+ $BUILD_INIT_BUILDSYSTEM "${definesnstuff[@]}" "${repos[@]}" $USEUSEDFORBUILD $RPMLIST "$MYSRCDIR/$SPECFILE" $ADDITIONAL_PACKS || cleanup_and_exit 1
fi
if test -z "$BUILD_DIST" -a -e "$BUILD_ROOT/.guessed_dist" ; then
export BUILD_DIR=${BUILD_DIR:-/usr/lib/build}
PROC_IS_MOUNTED=
definesnstuff=()
+repos=()
# should RPMs be installed with --force ?
USE_FORCE=false
RPMLIST=
while test -n "$1" ; do
- case $1 in
+ case "$1" in
--prepare)
shift
PREPARE_XEN=true
definesnstuff[${#definesnstuff[@]}]="$1";
definesnstuff[${#definesnstuff[@]}]="$2";
shift 2
- ;;
+ ;;
+ --repository)
+ repos[${#repos[@]}]="$2";
+ shift 2;
+ ;;
*)
break
;;
done
PKGS="$*"
+# for backward compatability
+repos=("${repos[@]}" ${BUILD_RPMS//:/ /})
+
#
# needed functions
#
}
function validate_cache_file {
- test "$BUILD_RPMS" != "$(cat $CACHE_FILE.id 2>/dev/null)" && rm -f $CACHE_FILE.id
+ test "${repos[*]}" != "$(cat $CACHE_FILE.id 2>/dev/null)" && rm -f $CACHE_FILE.id
test -f $CACHE_FILE || rm -f $CACHE_FILE.id
- for SRC in ${BUILD_RPMS//:/ } ; do
+ for SRC in "${repos[@]}" ; do
test -z "$SRC" && SRC=.
- test $SRC -nt $CACHE_FILE && rm -f $CACHE_FILE.id
+ test "$SRC" -nt $CACHE_FILE && rm -f $CACHE_FILE.id
done
if ! test -f $CACHE_FILE.id ; then
test -z "$LIST_STATE" && echo initializing $CACHE_FILE with find command...
- for SRC in ${BUILD_RPMS//:/ } ; do
+ for SRC in "${repos[@]}" ; do
test -z "$SRC" && SRC=.
- find $SRC -type f -name packages -print -o -follow -type f \( -name "*.rpm" -o -name "*.deb" \) -a ! -name "*src.rpm" -printf '%T@/%s/%i %p\n'
+ find "$SRC" -type f -name packages -print -o -follow -type f \( -name "*.rpm" -o -name "*.deb" \) -a ! -name "*src.rpm" -printf '%T@/%s/%i %p\n'
echo
done | createrpmdeps $CACHE_FILE > $CACHE_FILE.new
mv $CACHE_FILE.new $CACHE_FILE
- echo "$BUILD_RPMS" > $CACHE_FILE.id
+ echo "${repos[*]}" > $CACHE_FILE.id
fi
}