]> TLD Linux GIT Repositories - packages/rpm-build-tools.git/commitdiff
- added command to list pkgrevs (former auto tags)
authorMarcin Krol <hawk@tld-linux.org>
Sat, 27 Sep 2014 11:14:29 +0000 (11:14 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Sat, 27 Sep 2014 11:14:29 +0000 (11:14 +0000)
builder.sh

index 99c11d96c95df60d74137660831e6ddddf96d2d2..840aee5cad24f8219c62d54f81159fe6c75288ff 100755 (executable)
@@ -320,7 +320,7 @@ Usage: builder [--all-branches] [-D|--debug] [-V|--version] [--short-version]  [
 [{-Tp|--tag-prefix} <prefix>] [{-tt|--test-tag}]
 [-nu|--no-urls] [-v|--verbose] [--opts <rpm opts>] [--short-circuit]
 [--show-bconds] [--with/--without <feature>] [--define <macro> <value>]
-[--git-pld|--git-tld] [--pkgrev]
+[--git-pld|--git-tld] [--pkgrev] [-lp]
 <package>[.spec][:tag]
 
 -4                  - force IPv4 when transferring files
@@ -466,8 +466,9 @@ Usage: builder [--all-branches] [-D|--debug] [-V|--version] [--short-version]  [
 --git-pld           - force use of PLD git and distfiles
 --git-tld           - force use of TLD git and distfiles (note: it will fall
                       back to PLD git/df if package doesn't exist in TLD git)
---pkgrev            - write git revision of package being built into rsync repo
+--pkgrev            - save git revision of package being built into pkgrevs
                       (note: only official TLD source builders are allowed to do so)
+-lp                 - list pkgrevs for specified package
 "
 }
 
@@ -1514,6 +1515,14 @@ set_pkgrev() {
        Exit_error err_pkgrev_set
 }
 
+list_pkgrev() {
+       local _tmp=$(mktemp /tmp/.builder-XXXX)
+       rm $_tmp 2>/dev/null
+       $GETURI $OUTFILEOPT $_tmp $PKGREVS_URL/list/$PACKAGE_NAME 1>/dev/null 2>&1
+       cat $_tmp
+       rm $_tmp 2>/dev/null
+}
+
 branch_files() {
        TAG=$1
        echo "Git branch: $TAG"
@@ -2489,6 +2498,9 @@ while [ $# -gt 0 ]; do
                --pkgrev)
                        COMMAND="set_pkgrev"
                        shift;;
+               -lp)
+                       COMMAND="list_pkgrev"
+                       shift;;
                -*)
                        Exit_error err_invalid_cmdline "$1"
                        ;;
@@ -2843,6 +2855,15 @@ case "$COMMAND" in
                display_bconds
                set_pkgrev
                ;;
+       "list_pkgrev" )
+               init_builder
+               if [ -z "$SPECFILE" ]; then
+                       Exit_error err_no_spec_in_cmdl
+               fi
+               get_spec > /dev/null
+               parse_spec
+               list_pkgrev
+               ;;
 esac
 if [ -f "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES" -a "$REMOVE_BUILD_REQUIRES" != "" ]; then
        rm "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES"