From: Elan Ruusamäe Date: Tue, 24 Feb 2015 21:39:48 +0000 (+0200) Subject: relup: accept make-request style branches X-Git-Tag: auto/th/rpm-build-tools-4.6-4~11 X-Git-Url: http://git.pld-linux.org/?p=packages%2Frpm-build-tools.git;a=commitdiff_plain;h=f88a992736ec3a043fe9e8950837009a5d80b934 relup: accept make-request style branches --- diff --git a/relup.sh b/relup.sh index 9a07402..9bf8fa7 100755 --- 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,14 @@ package_name() { echo $package } +get_branch() { + local specfile="${1%/}" branch + + branch=${specfile#*:} + + echo ${branch:-master} +} + if [ ! -x /usr/bin/getopt ]; then echo >&1 "You need to install util-linux to use relup.sh" exit 1 @@ -135,6 +145,7 @@ n="${n%%n}" cd "$topdir" for pkg in "$@"; do + branch=$(get_branch "$pkg") # pkg: package %{name} pkg=$(package_name "$pkg") @@ -149,13 +160,13 @@ for pkg in "$@"; do specname=${spec##*/} # start real work - echo "$pkg ..." + echo "$pkg:$branch ..." # get package [ "$get" = 1 -a -d "$pkgdir" ] && continue if [ "$update" = "1" -o "$get" = "1" ]; then - ./builder -g -ns "$spec" + ./builder -g -ns "$spec" -r $branch fi [ "$get" = 1 ] && continue