package_name() {
local specfile="${1%/}" package
+ # strip branch
+ specfile=${specfile%:*}
# basename
specfile=${specfile##*/}
# strip .spec
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
cd "$topdir"
for pkg in "$@"; do
+ branch=$(get_branch "$pkg")
# pkg: package %{name}
pkg=$(package_name "$pkg")
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