]> TLD Linux GIT Repositories - tld-builder.git/commitdiff
- cosmetics and cleanup
authorMarcin Krol <hawk@tld-linux.org>
Sat, 20 Mar 2021 21:49:36 +0000 (22:49 +0100)
committerMarcin Krol <hawk@tld-linux.org>
Sat, 20 Mar 2021 21:49:36 +0000 (22:49 +0100)
client/make-request.sh

index 271a77771b8639f2bdcbefd6bd1e695707b9f9ce..aebc5dd2736e13127ae0181e3f49ca075b4e8980 100755 (executable)
@@ -17,7 +17,7 @@ dist=
 url=
 no_depend=no
 verbose=no
-autotag=no
+pkgrevision=no
 requester_override=
 relup=no
 
@@ -177,26 +177,9 @@ df_fetch() {
        done
 }
 
-# autotag from rpm-build-macros
-# 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 autotag for specs
-# WARNING: This may checkout some files from VCS
-get_autotag() {
-       local atag pkg spec rpmdir
+# get package revision for specs
+get_pkgrevision() {
+       local pkgrev pkg spec rpmdir
 
        rpmdir=$(rpm -E %_topdir)
        for pkg in "$@"; do
@@ -206,12 +189,12 @@ get_autotag() {
                # strip .spec extension
                pkg=${pkg%.spec}
                wget http://pkgrevs.tld-linux.org/list/$pkg -O /tmp/$pkg.tags 1>/dev/null 2>&1
-               atag=$(head -n 1 /tmp/$pkg.tags)
+               pkgrev=$(head -n 1 /tmp/$pkg.tags)
                rm -f /tmp/$pkg.tags
-               if [ "x$atag" = "x" ]; then
+               if [ "x$pkgrev" = "x" ]; then
                        echo "$pkg.spec"
                else
-                       echo "$pkg.spec:$atag"
+                       echo "$pkg.spec:$pkgrev"
                fi
        done
 }
@@ -345,7 +328,7 @@ while [ $# -gt 0 ]; do
                        ;;
 
                -a)
-                       autotag=yes
+                       pkgrevision=yes
                        ;;
 
                -m)
@@ -636,9 +619,9 @@ if [ "$relup" = "yes" ]; then
        relup ${message:+-m "$message"} $specs
 fi
 
-if [ "$autotag" = "yes" ]; then
-       msg "Auto autotag build enabled"
-       specs=$(get_autotag $specs)
+if [ "$pkgrevision" = "yes" ]; then
+       msg "Package revision build enabled"
+       specs=$(get_pkgrevision $specs)
 fi
 
 if [ "$df_fetch" = "yes" ]; then