BE_VERBOSE=""
QUIET=""
CLEAN=""
+DEBUG=""
CVSROOT=${CVSROOT:-""}
LOGFILE=""
usage()
{
-echo "\
-Usage: builder [-V] [--version] [-a] [--as_anon] [-b] [--build]
- [-d <cvsroot>] [--cvsroot <cvsroot>] [-g] [--get] [-h] [--help]
- [-l <logfile>] [--logtofile <logfile>] [-q] [--quiet]
- [-r <cvstag>] [--cvstag <cvstag>] [-v] [--verbose]
- <package>.spec
+ if [ -n "$DEBUG" ]; then set -xv; fi
+ echo "\
+Usage: builder [-D] [--debug] [-V] [--version] [-a] [--as_anon] [-b]
+ [--build] [-d <cvsroot>] [--cvsroot <cvsroot>] [-g] [--get] [-h]
+ [--help] [-l <logfile>] [--logtofile <logfile>] [-q] [--quiet] [-r
+ <cvstag>] [--cvstag <cvstag>] [-v] [--verbose] <package>.spec
+ -D, --debug - enable scrip debuging mode,
-V, --version - output builder version
-a, --as_anon - get files via pserver as cvs@cvs.pld.org.pl,
-b, --build - get all files from CVS repo and build
parse_spec()
{
+ if [ -n "$DEBUG" ]; then set -xv; fi
+
sed -e "s#%prep#%dump#I" $SPECFILE | grep -v -i Icon > $SPECFILE.__
SOURCES="`rpm -bp --test $SPECFILE.__ 2>&1 | awk '/ SOURCE[0-9]+/ {print $3}'|sed -e 's#.*/##g'`"
Exit_error()
{
+ if [ -n "$DEBUG" ]; then set -xv; fi
+
cd $__PWD
case "$@" in
init_builder()
{
+ if [ -n "$DEBUG" ]; then set -xv; fi
+
DUMB_SPEC_FILE=`mktemp -q /tmp/bilder.XXXXXX`
echo "\
Summary: -
get_spec()
{
+ if [ -n "$DEBUG" ]; then set -xv; fi
+
cd $SPECS_DIR
- OPTIONS=""
+ OPTIONS="up "
if [ -n "$CVSROOT" ]; then
OPTIONS="-d $CVSROOT"
fi
chmod 444 $SPECFILE
- unset $OPTIONS
+ unset OPTIONS
}
get_all_files()
{
-set -xv
+ if [ -n "$DEBUG" ]; then set -xv; fi
+
if [ -n "$SOURCES$PATCHES$ICONS" ]; then
cd $SOURCE_DIR
- OPTIONS=""
+ OPTIONS="up "
if [ -n "$CVSROOT" ]; then
OPTIONS="-d $CVSROOT"
fi
fi
chmod 444 $SOURCES $PATCHES $ICONS
- unset $OPTIONS
+ unset OPTIONS
fi
}
build_package()
{
+ if [ -n "$DEBUG" ]; then set -xv; fi
+
cd $SPECS_DIR
rpm -ba -v $QUIET $CLEAN $SPECFILE
while test $# -gt 0 ; do
case "${1}" in
+ -D | --debug )
+ DEBUG="yes"; shift ;;
-V | --version )
COMMAND="version"; shift ;;
-a | --as_anon )
esac
done
+if [ -n "$DEBUG" ]; then set -xv; fi
+
case "$COMMAND" in
"build" )
init_builder;