commit a3a42861063de25d81cf0c779724b7e32dc5d291
Author: Arkadiusz Miƛkiewicz <[email protected]>
Date:   Wed Dec 12 09:14:19 2018 +0100

    Allow make-request.sh working even of systems without rpm or not being PLD

 client/make-request.sh | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/client/make-request.sh b/client/make-request.sh
index b647e15..ed17f2d 100755
--- a/client/make-request.sh
+++ b/client/make-request.sh
@@ -189,17 +189,25 @@ autotag() {
 # get autotag for specs
 # WARNING: This may checkout some files from VCS
 get_autotag() {
-       local pkg spec rpmdir
+       local pkg spec rpmdir gitdir
 
-       rpmdir=$(rpm -E %_topdir)
+       rpmdir=$(rpm -E %_topdir 2> /dev/null)
        for pkg in "$@"; do
-               cd $rpmdir
                # strip branches
                pkg=${pkg%:*}
                # strip .spec extension
                pkg=${pkg%.spec}
+
+               if [ -n "$rpmdir" ]; then
+                       cd $rpmdir
+               else
+                       gitdir=$(mktemp -d) || exit 1
+                       cd $gitdir
+                       git clone --depth=1 
git://git.pld-linux.org/packages/$pkg
+               fi
+
                # checkout only if missing
-               if [ ! -e $pkg/$pkg.spec ]; then
+               if [ ! -e $pkg/$pkg.spec -a -x $rpmdir/builder ]; then
                        $rpmdir/builder -g $pkg -ns -r HEAD 1>&2
                fi
                if [ ! -e $pkg/$pkg.spec ]; then
@@ -209,6 +217,8 @@ get_autotag() {
                        cd $pkg
                        autotag $pkg.spec
                fi
+
+               [ -d "$gitdir" ] && rm -rf "$gitdir"
        done
 }
 
================================================================

---- gitweb:

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

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to