]> TLD Linux GIT Repositories - packages/rpm-build-tools.git/blobdiff - relup.sh
- merged PLD changes
[packages/rpm-build-tools.git] / relup.sh
index 9a07402e5bfc5f0a574a31c602f59cd8f45de329..7557ba619b1282596364914aa6d253ba8159fbea 100755 (executable)
--- a/relup.sh
+++ b/relup.sh
@@ -77,6 +77,8 @@ bump_release() {
 package_name() {
        local specfile="${1%/}" package
 
+       # strip branch
+       specfile=${specfile%:*}
        # basename
        specfile=${specfile##*/}
        # strip .spec
@@ -85,6 +87,18 @@ package_name() {
        echo $package
 }
 
+get_branch() {
+       local specfile="${1%/}" branch
+
+       branch=${specfile#*:}
+
+       if [ "$branch" != "$specfile" ]; then
+               echo "$branch"
+       else
+               echo ""
+       fi
+}
+
 if [ ! -x /usr/bin/getopt ]; then
        echo >&1 "You need to install util-linux to use relup.sh"
        exit 1
@@ -135,6 +149,7 @@ n="${n%%n}"
 
 cd "$topdir"
 for pkg in "$@"; do
+       branch=$(get_branch "$pkg")
        # pkg: package %{name}
        pkg=$(package_name "$pkg")
 
@@ -149,13 +164,21 @@ for pkg in "$@"; do
        specname=${spec##*/}
 
        # start real work
-       echo "$pkg ..."
+       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"
+               if [ -n "$branch" ]; then
+                       ./builder -g -ns "$spec" -r $branch
+               else
+                       ./builder -g -ns "$spec"
+               fi
        fi
 
        [ "$get" = 1 ] && continue