[projects/pld-builder.new] Add support for auto-tag from specified branch

arekm arekm at pld-linux.org
Thu Aug 21 13:30:11 CEST 2025


commit a14f4510998695be041b0821db04dcfb0b3b2eed
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Aug 21 13:29:57 2025 +0200

    Add support for auto-tag from specified branch

 client/make-request.sh | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/client/make-request.sh b/client/make-request.sh
index 62294c9..99391c1 100755
--- a/client/make-request.sh
+++ b/client/make-request.sh
@@ -175,15 +175,19 @@ df_fetch() {
 # autotag from rpm-build-macros
 # displays latest used tag for a specfile
 autotag() {
-	local out s
+	local out s branch
 	for s in "$@"; do
+		# get branch only
+		branch=${s#*:}
+		branch=${branch%%"$s"}
+		[ -n "$branch" ] && branch="--merged=$branch"
 		# 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)')
+			--format='%(refname:short)' $branch)
 		echo "$s:$out"
 	done
 }
@@ -195,6 +199,9 @@ get_autotag() {
 
 	rpmdir=$(rpm -E %_topdir 2> /dev/null)
 	for pkg in "$@"; do
+		# get branch only
+		branch=${pkg#*:}
+		branch=${branch%%"$pkg"}
 		# strip branches
 		pkg=${pkg%:*}
 		# strip .spec extension
@@ -217,7 +224,7 @@ get_autotag() {
 			echo "$pkg"
 		else
 			cd $pkg
-			autotag $pkg.spec
+			[ -n "$branch" ] && autotag $pkg.spec:$branch || autotag $pkg.spec
 		fi
 
 		[ -d "$gitdir" ] && rm -rf "$gitdir"
@@ -239,7 +246,9 @@ Mandatory arguments to long options are mandatory for short options too.
             Source additional config file (after $USER_CFG), useful when
             when sending build requests to Ac/Th from the same account
       -a
-            Try to use latest auto-tag for the spec when building
+            Try to use latest auto-tag for the spec when building.
+            Supports using latest auto-tag from a specified branch.
+
             WARNING: This will checkout new files to your packages dir
       -b 'BUILDER BUILDER ...',  --builder='BUILDER BUILDER ...'
             Sends request to given builders (in 'version-arch' format)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/a14f4510998695be041b0821db04dcfb0b3b2eed



More information about the pld-cvs-commit mailing list