Commit d30e3d25 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmrb, rpmbsh: add -a TASK, -A, -f options

- rpmrb: add -a TASK to add to existing task after build - rpmrb: add -A to add to the last task after build - rpmrb: add -f for force tag overwrite - rpmbsh: add -a TASK and -A options, pass them to rpmbs
parent 29e390b3
...@@ -16,7 +16,7 @@ REMCOM= ...@@ -16,7 +16,7 @@ REMCOM=
COMMIT= COMMIT=
############################# #############################
Usage="Usage: $name [GIRAR] [-s -u -m -i -c -e ] [-b REPONAME] [-f] [spec or src.rpm]..." Usage="Usage: $name [GIRAR] [-s -u -a TASK -A -i -c -e ] [-b REPONAME] [-f] [spec or src.rpm]..."
function mygetopts() function mygetopts()
{ {
name=${0##*/} name=${0##*/}
...@@ -29,6 +29,8 @@ phelp() ...@@ -29,6 +29,8 @@ phelp()
echo echo
echog "Options:" echog "Options:"
echog " -u sign and run gear build task after build" echog " -u sign and run gear build task after build"
echog " -a TASK sign and add to existing (shared) task TASK after build"
echog " -A sign and add to the last task after build"
echog " -i install built packages in test hasher (via loginhsh -t)" echog " -i install built packages in test hasher (via loginhsh -t)"
echog " -f force tag set (see rpmbs --help)" echog " -f force tag set (see rpmbs --help)"
echo "$HELP_GIRAR" echo "$HELP_GIRAR"
...@@ -44,11 +46,14 @@ phelp() ...@@ -44,11 +46,14 @@ phelp()
} }
PASSEDARGS= PASSEDARGS=
while getopts :hieufclstwb: opt; do TASKARG=
while getopts :hieufclstwb:a:A opt; do
case $opt in case $opt in
h) phelp; exit 0;; h) phelp; exit 0;;
t) COMMIT="--commit" ;; t) COMMIT="--commit" ;;
u|f|c|e|s|l) PASSEDARGS="$PASSEDARGS -$opt" ;; u|f|c|e|s|l) PASSEDARGS="$PASSEDARGS -$opt" ;;
A) TASKARG="-A" ;;
a) TASKARG="-a $OPTARG" ;;
w) THOROUGH="-a" ;; w) THOROUGH="-a" ;;
i) INSTALLPKG=1 ;; i) INSTALLPKG=1 ;;
b) BINARYREPONAME=$OPTARG ;; b) BINARYREPONAME=$OPTARG ;;
...@@ -141,5 +146,5 @@ else ...@@ -141,5 +146,5 @@ else
TSKLIST="$LISTBUILT" TSKLIST="$LISTBUILT"
fi fi
docmd $ETERBUILDBIN/rpmbs $GIRARHOST -b $BINARYREPO $RPMBSARGS $TSKLIST docmd $ETERBUILDBIN/rpmbs $GIRARHOST -b $BINARYREPO $TASKARG $RPMBSARGS $TSKLIST
...@@ -13,44 +13,53 @@ load_mod spec git ...@@ -13,44 +13,53 @@ load_mod spec git
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echog "rpmrb (Re Build) - update spec to vermajor.verminor version, build %rel release" echog "rpmrb (Re Build) - update spec to vermajor.verminor version, build %rel release"
echog "Usage: rpmrb [GIRAR] [-n] [spec] [vermajor][.verminor] [rel]" echog "Usage: rpmrb [GIRAR] [-n] [-f] [-a TASK | -A] [spec] [vermajor][.verminor] [rel]"
echog " -n - skip install built package in hasher for testing purposes" echog " -n - skip install built package in hasher for testing purposes"
echog " -f - force tag overwrite"
echog " -a TASK - add to existing (shared) task TASK after build"
echog " -A - add to the last task after build"
echo "$HELP_GIRAR" echo "$HELP_GIRAR"
echog "Example:" echog "Example:"
echog " $ rpmrb [name.spec] 22.6 alt2" echog " $ rpmrb [name.spec] 22.6 alt2"
echog " $ rpmrb 1.2.3" echog " $ rpmrb 1.2.3"
echog " $ rpmrb -A 1.2.3"
exit 0 exit 0
fi fi
INSTALLINHASHER='-i' INSTALLINHASHER='-i'
UPLOADARG='-u'
FORCEARG=
parse_r() parse_r()
{ {
while [ -n "$1" ] ; do
case "$1" in case "$1" in
-n) -n)
INSTALLINHASHER='' INSTALLINHASHER=''
shift shift
;; ;;
-*) -f)
fatal "Unsupported option "$1". See --help." FORCEARG='-f'
;; shift
*) ;;
esac -a)
UPLOADARG="-a $2"
shift 2
;;
-A)
UPLOADARG='-A'
shift
;;
-*)
fatal "Unsupported option $1. See --help."
;;
*)
break
;;
esac
done
VER="$1" VER="$1"
case "$2" in
-n)
INSTALLINHASHER=''
shift
;;
-*)
fatal "Unsupported option "$2". See --help."
;;
*)
esac
# need for rpmgs # need for rpmgs
GSSETRELEASE="$2" GSSETRELEASE="$2"
} }
...@@ -87,4 +96,4 @@ for SPEC in $LISTNAMES ; do ...@@ -87,4 +96,4 @@ for SPEC in $LISTNAMES ; do
cd - >/dev/null cd - >/dev/null
done done
docmd $ETERBUILDBIN/rpmbsh $GIRARHOST $INSTALLINHASHER -u $LISTNAMES docmd $ETERBUILDBIN/rpmbsh $GIRARHOST $INSTALLINHASHER $FORCEARG $UPLOADARG $LISTNAMES
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