Fetching contributors…
Cannot retrieve contributors at this time
executable file 59 lines (48 sloc) 1.25 KB
#!/bin/sh
## ---------------------------------------------
## reading definitions...
if [ -z "$YABS_PROFILE" ]; then
YABS_CONFIG=/etc/yabs/yabs.conf
else
YABS_CONFIG=/etc/yabs/yabs-"$YABS_PROFILE".conf
fi
## ---------------------------------------------
## internal declarations
# yabs builder script location
YABS="/usr/sbin/yabs-worker"
## ---------------------------------------------
## main
set -e
. "$YABS_CONFIG"
if [ "$1" = "-h" -o "$1" = "--help" ]; then
echo "Usage: $0 [directory-with-spec-files]" >&2
exit 1
fi
RUNDIR="$1"
[ -z "$RUNDIR" ] && RUNDIR=`pwd`
[ -d "$RUNDIR" ] && cd "$RUNDIR"
if [ -f "$RUNDIR" ]; then
SPECLIST="$RUNDIR"
elif [ -f specs.list ]; then
SPECLIST=`cat specs.list | \
grep --invert-match --extended-regexp '^\s*#'`
else
SPECLIST=`ls *.spec`
fi
if [ "$SKIP_REPO" ]; then
TARGETDIR="$RUNDIR/target"
else
TARGETDIR=$REPO
fi
RPM_DIR="$TARGETDIR/RPMS"
mkdir -p "$RPM_DIR"
for SPEC in $SPECLIST; do
[ -f "$SPEC" ] || continue
echo -e "\n\n---------------CUT-HERE----------------"
echo -e "--- $SPEC\n\n"
sudo -n "$YABS" "$SPEC" "$ROOTFS" "$TARGETDIR" "$REPO_LIST" "$MINIMAL_SET" "$ART_REPO"
done
if [ ! "$SKIP_REPO" ]; then
( cd "$RPM_DIR"
sudo -n createrepo .; )
fi