[packages/rpm-build-tools] unfinished qt5 updater

glen glen at pld-linux.org
Mon Aug 10 11:00:44 CEST 2015


commit 6e5812f743a00f43a441bdf5f07eb71e3e8429c7
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sat Jun 13 23:07:52 2015 +0300

    unfinished qt5 updater

 update-qt5.sh | 47 +++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 41 insertions(+), 6 deletions(-)
---
diff --git a/update-qt5.sh b/update-qt5.sh
index 3848eb7..9a3e3c9 100755
--- a/update-qt5.sh
+++ b/update-qt5.sh
@@ -39,6 +39,7 @@ dir=$(dirname "$0")
 APPDIR=$(d=$0; [ -L "$d" ] && d=$(readlink -f "$d"); dirname "$d")
 PATH=$APPDIR:$PATH
 topdir=$(rpm -E '%{_topdir}')
+dist=th
 
 # get package, no sources
 get_package() {
@@ -46,14 +47,48 @@ get_package() {
 	out=$(builder -g -ns $pkg 2>&1) || echo "$out"
 }
 
+# get version fron $specfile
+get_version() {
+	local specfile="$1"
+
+	awk '/^Version:[ 	]+/{print $NF}' $specfile | tail -n1
+}
+
+# displays latest used tag for a specfile
+autotag() {
+	local out s
+	for s in "$@"; do
+		# strip branches
+		s=${s%:*}
+		# ensure package ends with .spec
+		s=${s%.spec}.spec
+		git fetch --tags
+		out=$(git for-each-ref --count=1 --sort=-authordate refs/tags/auto/$dist \
+			--format='%(refname:short)')
+		echo "$s:$out"
+	done
+}
+
+# get $pkg, setup $package, $version, $tag
+setup_package() {
+	local package=$1
+	local specfile=$package.spec
+	get_package $package
+	version=$(cd $package && get_version $specfile)
+	tag=$(cd $package && autotag $specfile)
+}
+
 cd "$topdir"
+
+# get new version from qtbase package
+setup_package qt5-qtbase
+echo "Updating version to $version (based on qt5-qtbase)"
+set_version=$version
+
 for pkg in ${*:-$packages}; do
 	pkg=${pkg%.spec}
-	echo "* $pkg"
-
-	get_package $pkg
-	cd $pkg
-	specfile=*.spec
+	echo -n "* $pkg ... "
 
-	cd ..
+	setup_package $pkg
+	echo "$version $tag"
 done
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-tools.git/commitdiff/a21c7e667653829e874d37ac577b60c185b8fadc



More information about the pld-cvs-commit mailing list