--- /dev/null
+#!/bin/sh
+# Authors:
+# - Bartosz Świątek (shadzik@tld-linux.org)
+#
+# helps sending kde4 specs in proper order with or without autotags
+
+usage() {
+ echo "Usage: $0 OPTIONS SPECS"
+ echo ""
+ echo "Where OPTIONS are:"
+ echo ""
+ echo " -d --distro VALUE"
+ echo " set distro, probably th or ti will fit the most"
+ echo " -at --with-auto-tag"
+ echo " send with current autotag, default no"
+ echo " -b --builder VALUE"
+ echo " choose a particular builder, default all"
+ echo " -p --priority VALUE (default: 2)"
+ echo " -h --help"
+ echo " show this help"
+ echo ""
+ echo "Choose SPECS out of:"
+ echo ""
+ echo "all - all * (libs, base, other, koffice, l10n)"
+ echo "libs - kdelibs and kdepimlibs kdelibs-experimental"
+ echo "base - kdebase* oxygen-icons"
+ echo "other - all other * except libs and base"
+ echo "koffice - koffice"
+ echo "l10n - l10n"
+ echo "kdevelop - devplatform, kdevelop-*"
+ echo "almost-all - all but koffice and l10n"
+ echo ""
+ exit 0
+}
+
+DIST=
+ATAG=no
+SENDPRIO=
+BUILDER=
+PRIO=2
+#SPECDIR=$(rpm -E %_specdir)
+SPECDIR=~/rpm
+
+LIBS="kdelibs.spec kdepimlibs.spec"
+BASE="kactivities oxygen-icons.spec kde-workspace.spec kde-runtime.spec kde-baseapps.spec kde-wallpapers.spec"
+OTHER="jovie.spec \
+kaccessible.spec \
+kmouth.spec \
+kmousetool.spec \
+kmag.spec \
+ark.spec \
+filelight.spec \
+kcalc.spec \
+kcharselect.spec \
+kdf.spec \
+kfloppy.spec \
+kgpg.spec \
+kremotecontrol.spec \
+ktimer.spec \
+kwallet.spec \
+superkaramba.spec \
+sweeper.spec \
+python-PyKDE4.spec \
+kdeadmin.spec \
+libkexiv2.spec \
+kdeartwork.spec \
+kdegames.spec \
+kdemultimedia.spec \
+kdenetwork.spec \
+kdepim-runtime.spec \
+kdepim.spec
+marble.spec \
+kdeplasma-addons.spec \
+kdewebdev.spec \
+libkdcraw.spec \
+libkdeedu.spec \
+libkipi.spec \
+libksane.spec \
+gwenview.spec \
+analitza.spec \
+kalgebra.spec \
+kamera.spec \
+kate.spec \
+kcolorchooser.spec \
+kgamma.spec \
+kolourpaint.spec \
+konsole.spec \
+kruler.spec \
+ksnapshot.spec \
+okular.spec \
+kdegraphics-mobipocket.spec \
+kdegraphics-strigi-analyzer.spec \
+kdegraphics-thumbnailers.spec \
+svgpart.spec \
+ksaneplugin.spec \
+kdetoys.spec"
+KOFFICE="koffice.spec koffice-l10n.spec"
+L10N="l10n.spec"
+KDEVELOP="kdevplatform.spec \
+kdevelop.spec
+kdevelop-plugin-php.spec"
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ --distro | -d )
+ DIST=$2
+ shift
+ ;;
+
+ --with-auto-tag | -at )
+ ATAG=yes
+ ;;
+
+ --builder | -b )
+ BUILDER="$BUILDER $2"
+ shift
+ ;;
+
+ --priority | -p )
+ PRIO=$2
+ shift
+ ;;
+
+ --help | -h )
+ usage
+ ;;
+
+ -* )
+ die "Unknow option: $1"
+ ;;
+
+ *:* | * )
+ specs="$specs $1"
+ ;;
+ esac
+ shift
+done
+
+specs=`for s in $specs; do
+ case "$s" in
+ all) # all kde4 specs
+ echo $LIBS $BASE $OTHER $KOFFICE $L10N
+ ;;
+ libs) # kde4 libs, libs-experimental and pimlibs
+ echo $LIBS
+ ;;
+ base) # kdebase-*
+ echo $BASE
+ ;;
+ other) # *
+ echo $OTHER
+ ;;
+ koffice) # koffice
+ echo $KOFFICE
+ ;;
+ l10n) # l10n
+ echo $L10N
+ ;;
+ kdevelop) # kdevplatform and kdevelop-*
+ echo $KDEVELOP
+ ;;
+ almost-all) # all but koffice and l10n
+ echo $LIBS $BASE $OTHER
+ ;;
+ *) # not listed ones
+ echo $s
+ ;;
+ esac
+done`
+
+if [ "$DIST" == "ti-dev" ]; then
+ disttag="ti"
+else
+ disttag=$DIST
+fi
+
+if [ "$ATAG" == "yes" ]; then
+ for spec in $specs; do
+ PKG=$(echo $spec |sed -e 's/.spec//g')
+ LAST_AUTOTAG=$(cd $SPECDIR/packages && ksh ./builder -g -ns $PKG/$spec >/dev/null 2>&1 && cvs status -v $PKG/$spec | awk -vdist=$disttag '!/Sticky/ && $1 ~ "^auto-" dist "-"{if (!a++) print $1}')
+ sleep 1
+ SENDPRIO="$SENDPRIO $spec:$LAST_AUTOTAG "
+ done
+else
+ SENDPRIO=$specs
+fi
+
+dir=$(dirname "$0")
+exec sh $dir/make-request.sh ${DIST:+-d $DIST} ${BUILDER:+-b "$BUILDER"} -p $PRIO -r $SENDPRIO
+echo >&2 "Failed to execute ./make-request.sh!"
+exit 1