[packages/rpm-build-tools] - fix branch support when no branch is specified

baggins baggins at pld-linux.org
Fri Apr 10 20:30:42 CEST 2015


commit 5167c72b4c3c72a533efdb59a89f8488fa95cb48
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Fri Apr 10 20:30:26 2015 +0200

    - fix branch support when no branch is specified

 relup.sh | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/relup.sh b/relup.sh
index 9bf8fa7..7557ba6 100755
--- a/relup.sh
+++ b/relup.sh
@@ -92,7 +92,11 @@ get_branch() {
 
 	branch=${specfile#*:}
 
-	echo ${branch:-master}
+	if [ "$branch" != "$specfile" ]; then
+		echo "$branch"
+	else
+		echo ""
+	fi
 }
 
 if [ ! -x /usr/bin/getopt ]; then
@@ -160,13 +164,21 @@ for pkg in "$@"; do
 	specname=${spec##*/}
 
 	# start real work
-	echo "$pkg:$branch ..."
+	if [ -n "$branch" ]; then
+		echo "$pkg:$branch ..."
+	else
+		echo "$pkg ..."
+	fi
 
 	# get package
 	[ "$get" = 1 -a -d "$pkgdir" ] && continue
 
 	if [ "$update" = "1" -o "$get" = "1" ]; then
-		./builder -g -ns "$spec" -r $branch
+		if [ -n "$branch" ]; then
+			./builder -g -ns "$spec" -r $branch
+		else
+			./builder -g -ns "$spec"
+		fi
 	fi
 
 	[ "$get" = 1 ] && continue
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list