Commit 49759503 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmrb: rewrite to support multiple dirs/spec in common task

parent 497e0528
#!/bin/sh #!/bin/sh
# 2006, 2008, 2013 (c) Etersoft www.etersoft.ru # 2006, 2008, 2013, 2016 (c) Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru> # Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain # Public domain
# #
...@@ -20,37 +20,49 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then ...@@ -20,37 +20,49 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
exit 0 exit 0
fi fi
parse_r()
{
VER=$1
case "$2" in
-*)
fatal "No options are supported. See --help."
;;
*)
esac
# need for rpmgs
GSSETRELEASE=$2
}
set_girar_host $1 && shift set_girar_host $1 && shift
SPEC=$1 parse_cmd_pre_spec "$@"
# allow run with spec file (obsoleted)
[ -r "$SPEC" ] && shift
[ -s "$SPEC" ] || SPEC=$(get_gear_spec) parse_r $LISTARGS
[ -s "$SPEC" ] || fatal "Can't find spec file. Run $0 --help for help."
VER=$1 # assure we have only specs or src.rpm
LISTNAMES=$(repodirs_to_specs $LISTNAMES)
case "$2" in #[ -s "$SPEC" ] || fatal "Can't find spec file. Run $0 --help for help."
-*)
fatal "No options are supported. See --help."
;;
*)
esac
# need for rpmgs for SPEC in $LISTNAMES ; do
GSSETRELEASE=$2 set_specdir $SPEC
test -n "$GSSETRELEASE" || GSSETRELEASE=$(get_txtrelease $SPEC)1 docmd cd $SPECDIR || fatal
export GSSETRELEASE
docmd $ETERBUILDBIN/rpmgs $SPEC $VER || fatal "Error with get source" test -n "$GSSETRELEASE" || GSSETRELEASE=$(get_txtrelease $SPEC)1
add_changelog_helper "- new version $(get_version $SPEC) (with rpmrb script)" $SPEC || echog "Changelog entry already exists" export GSSETRELEASE
if is_gear ; then docmd $ETERBUILDBIN/rpmgs $SPEC $VER || fatal "Error with get source"
#git diff $SPEC add_changelog_helper "- new version $(get_version $SPEC) (with rpmrb script)" $SPEC || echog "Changelog entry already exists"
git_commit_ignore_nothing $SPEC -m "update spec to new build $(get_version $SPEC) (with rpmrb script)" || exit 1
fi if is_gear ; then
#git diff $SPEC
git_commit_ignore_nothing $SPEC -m "update spec to new build $(get_version $SPEC) (with rpmrb script)" || exit 1
fi
cd - >/dev/null
done
showcmd $ETERBUILDBIN/rpmbsh -i $SPEC showcmd $ETERBUILDBIN/rpmbsh -i $LISTNAMES
$ETERBUILDBIN/rpmbsh -i $SPEC || fatal "Error with build in hasher" $ETERBUILDBIN/rpmbsh -i -u $LISTNAMES
docmd $ETERBUILDBIN/rpmbs $GIRARHOST -u $SPEC || fatal "Error with upload"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment