Commit 4c7f8cc5 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmbb: add -R option for buildreq -bi

parent 2d937e9a
...@@ -24,7 +24,7 @@ fi ...@@ -24,7 +24,7 @@ fi
############################# #############################
Usage="Usage: $name [-c -p -i -r] spec..." Usage="Usage: $name [-c -p -i -r -R] spec..."
function mygetopts() function mygetopts()
{ {
name=${0##*/} name=${0##*/}
...@@ -39,15 +39,17 @@ phelp() ...@@ -39,15 +39,17 @@ phelp()
echog " -i - install and package" echog " -i - install and package"
echog " -p - packaging installed files into package" echog " -p - packaging installed files into package"
echog " -r - find build requires" echog " -r - find build requires"
echog " -R - find build requires with -bi"
} }
while getopts :hcipr opt; do while getopts :hciprR opt; do
case $opt in case $opt in
h) phelp; exit 0;; h) phelp; exit 0;;
c) BUILDOPT="c" ;; c) BUILDOPT="c" ;;
i) BUILDOPT="i b" ;; i) BUILDOPT="i b" ;;
p) BUILDOPT="b" ;; p) BUILDOPT="b" ;;
r) BUILDREQ=1 ;; r) BUILDREQ="-bc" ;;
R) BUILDREQ="-bi" ;;
+?) echog "$name: options should not be preceded by a '+'." 1>&2; exit 2;; +?) echog "$name: options should not be preceded by a '+'." 1>&2; exit 2;;
# ?) echog "$name: $OPTARG: bad option. Use -h for help." 1>&2 ; exit 2;; # ?) echog "$name: $OPTARG: bad option. Use -h for help." 1>&2 ; exit 2;;
?) OPTIND=$((OPTIND-1)); break; ?) OPTIND=$((OPTIND-1)); break;
...@@ -80,9 +82,9 @@ fi ...@@ -80,9 +82,9 @@ fi
# instead cbuild req # instead cbuild req
if [ -n "$BUILDREQ" ] ; then if [ -n "$BUILDREQ" ] ; then
uni_buildreq $LISTNAMES uni_buildreq $BUILDREQ $LISTNAMES
RET=$? RET=$?
echog "You can run buildreq with -bi param for search a dependences for install section of the package" echog "You can run with -R param for search a dependences for install section of the package (as with buildreq -bi)"
exit $RET exit $RET
fi fi
......
...@@ -77,15 +77,17 @@ uni_rpmbuild() ...@@ -77,15 +77,17 @@ uni_rpmbuild()
uni_buildreq() uni_buildreq()
{ {
local RET=0 local RET=0
local BUILDREQPARAM="$1"
shift
local SPECNAME=$(realpath "$1") local SPECNAME=$(realpath "$1")
shift shift
local SPECDIR=`dirname $SPECNAME` local SPECDIR=`dirname $SPECNAME`
local GEARBUILDREQ=gear-buildreq local GEARBUILDREQ=gear-buildreq
if is_gear $SPECDIR ; then if is_gear $SPECDIR ; then
$NICE $GEARBUILDREQ --commit -- "$SPECNAME" $@ || RET=$? $NICE $GEARBUILDREQ $BUILDREQPARAM --commit -- "$SPECNAME" $@ || RET=$?
else else
$NICE buildreq "$SPECNAME" $@ || RET=$? $NICE buildreq $BUILDREQPARAM "$SPECNAME" $@ || RET=$?
fi fi
return $RET return $RET
} }
......
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