]> TLD Linux GIT Repositories - packages/rpm-build-tools.git/commitdiff
Merge branch 'master' of git.tld-linux.org:packages/scripts
authorMarcin Krol <hawk@tld-linux.org>
Mon, 9 Jul 2012 12:21:21 +0000 (12:21 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Mon, 9 Jul 2012 12:21:21 +0000 (12:21 +0000)
builder
kde4send2builders.sh [new file with mode: 0755]
relup.sh [new file with mode: 0755]

diff --git a/builder b/builder
index 479a0c27d25459111bd3acb959e6f03d52f3158b..00a7c990a1faace213cfb488ba93dd09f69b6d33 100755 (executable)
--- a/builder
+++ b/builder
@@ -1499,16 +1499,16 @@ build_package() {
                        echo ""
                fi
                # try to nicely show package list, to just copy&paste it to poldek or so...
-               eval ${NICE_COMMAND} $RPMBUILD $TARGET_SWITCH $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $RPMBUILDOPTS $BCOND --define \'_specdir $PACKAGE_DIR\' --define \'_sourcedir $PACKAGE_DIR\' $SPECFILE 2>$BRLISTFILE
-               BRLIST=$(awk 'BEGIN{ORS=" ";} NR>1 {print $1;}' $BRLISTFILE)
-               echo
-               echo "To install packages type:"
-               echo "poldek -ivh $BRLIST"
-               echo
-               echo "In poldek, copy these command:"
-               echo "install $BRLIST"
-               echo
-               rm $BRLISTFILE
+               #eval ${NICE_COMMAND} $RPMBUILD $TARGET_SWITCH $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $RPMBUILDOPTS $BCOND --define \'_specdir $PACKAGE_DIR\' --define \'_sourcedir $PACKAGE_DIR\' $SPECFILE 2>$BRLISTFILE
+               #BRLIST=$(awk 'BEGIN{ORS=" ";} NR>1 {print $1;}' $BRLISTFILE)
+               #echo
+               #echo "To install packages type:"
+               #echo "poldek -ivh $BRLIST"
+               #echo
+               #echo "In poldek, copy these command:"
+               #echo "install $BRLIST"
+               #echo
+               #rm $BRLISTFILE
                Exit_error err_build_fail
        fi
        unset BUILD_SWITCH
diff --git a/kde4send2builders.sh b/kde4send2builders.sh
new file mode 100755 (executable)
index 0000000..4b5cbf1
--- /dev/null
@@ -0,0 +1,191 @@
+#!/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"
+       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
diff --git a/relup.sh b/relup.sh
new file mode 100755 (executable)
index 0000000..f7b6040
--- /dev/null
+++ b/relup.sh
@@ -0,0 +1,137 @@
+#!/bin/sh
+# script to run after "release bump" style change.
+# takes Release from spec and creates commit with message
+# groups similiar commits together.
+# "- release $rel"
+
+set -e
+
+get_dump() {
+       local specfile="$1"
+       if ! out=$(rpm --specfile "$specfile" --define 'prep %dump' -q 2>&1); then
+               echo >&2 "$out"
+               echo >&2 "You need icon files being present in SOURCES."
+               exit 1
+       fi
+       echo "$out"
+}
+
+usage="Usage:
+${0##*/} [-i] [-u] [-t] [-n] [-m <MESSAGE>] <SPECLIST>
+
+Options:
+-i
+  Try to increment package release
+-u
+  git pull first
+-t | -n
+  Test mode (dry-run). do not commit
+-m
+  Specify commit message
+
+"
+
+get_release() {
+       local specfile="$1"
+       rel=$(awk '/^%define[   ]+_?rel[        ]+/{print $NF}' $specfile)
+       if [ -z "$rel" ]; then
+               dump=$(get_dump "$specfile")
+               rel=$(echo "$dump" | awk '/PACKAGE_RELEASE/{print $NF; exit}')
+       fi
+       echo $rel
+}
+
+set_release() {
+       local specfile="$1"
+       local rel="$2"
+       local newrel="$3"
+       sed -i -e "
+               s/^\(%define[ \t]\+_\?rel[ \t]\+\)$rel\$/\1$newrel/
+               s/^\(Release:[ \t]\+\)$rel\$/\1$newrel/
+       " $specfile
+}
+
+if [ ! -x /usr/bin/getopt ]; then
+       echo >&1 "You need to install util-linux to use relup.sh"
+       exit 1
+fi
+
+t=$(getopt -o 'm:inuth' -n "${0##*/}" -- "$@") || exit $?
+# Note the quotes around `$t': they are essential!
+eval set -- "$t"
+
+while true; do
+       case "$1" in
+       -i)
+               inc=1
+               ;;
+       -u)
+               update=1
+               ;;
+       -t | -n)
+               test=1
+               ;;
+       -m)
+               shift
+               message="${1#- }"
+               ;;
+       -h)
+               echo "$usage"
+               exit 0
+               ;;
+       --)
+               shift
+               break
+       ;;
+       *)
+               echo 2>&1 "Internal error: [$1] not recognized!"
+               exit 1
+               ;;
+       esac
+       shift
+done
+
+tmpd=$(mktemp -d "${TMPDIR:-/tmp}/relXXXXXX")
+topdir=$(rpm -E '%{_topdir}')
+cd "$topdir"
+for pkg in "$@"; do
+       name=${pkg%.spec} name=${name##*/}
+       spec=$(rpm -D "name $name" -E '%{_specdir}/%{name}.spec')
+       spec=${spec#$topdir/}
+       if [ "$update" = "1" ]; then
+               ./builder -g -ns "$spec"
+       fi
+       rel=$(get_release "$spec")
+       if [ "$inc" = 1 ]; then
+               if [[ $rel = *%* ]]; then
+                       relmacro=${rel#*%}
+                       relnum=${rel%%%*}
+                       newrel=$(expr ${relnum} + 1)
+                       set_release "$spec" $rel "${newrel}%${relmacro}"
+               else
+                       newrel=$(expr ${rel} + 1)
+                       set_release "$spec" $rel $newrel
+               fi
+
+               # refetch release
+               rel=$(get_release "$spec")
+       fi
+       echo "$spec" >> "$tmpd/$rel"
+done
+
+n="$(echo -e '\nn')"
+n="${n%%n}"
+for file in $(ls "$tmpd" 2>/dev/null); do
+       files=$(cat "$tmpd/$file")
+       rel=$(basename "$file")
+       msg=""
+       [ -n "$message" ] && msg="$msg- $message$n"
+       msg="$msg- release ${rel%%%*} (by relup.sh)$n"
+       echo git commit -a -m "'$msg'"
+       if [ "$test" != 1 ]; then
+               cd $(dirname $1)
+               #git commit -m "$msg" $files
+               git commit -a -m "$msg"
+       fi
+done
+rm -rf $tmpd