Commit 7853a972 authored by Vitaly Lipatov's avatar Vitaly Lipatov

fix binary repo using (-b handling)

parent d4060c66
......@@ -54,6 +54,8 @@ LISTRPMARGS=$@
parse_cmd_pre "$@"
mygetopts $LISTARGS
# see functions/alt:set_binaryrepo() for BINARYREPONAME
set_binaryrepo $MENV
RESULT=0
......
......@@ -39,17 +39,18 @@ phelp()
echog " -q quiet"
echo
echog "Examples:"
echog " $ rpmbph -b p6 -n -u - backport to p6 and ask to build it"
echog " $ rpmbph -b $EXAMPLEALTDISTRVERSION -n -u - backport to $EXAMPLEALTDISTRVERSION and ask to build it"
# echog "Set ROOTDIR variable for backport to the other system"
# echog " -m - send result via e-mail"
}
# FIXME: has difference between
UPLOADARG=
while getopts :hnvqb: opt; do
case $opt in
h) phelp; exit 0 ;;
n) NOBUILD=1 ;;
#u) UPLOADARG="-$opt" ;;
u) UPLOADARG="-$opt" ;;
v) VERBOSE=1 ;;
b) BINARYREPONAME=$OPTARG ;;
q) QUIET=1 ;;
......@@ -64,7 +65,7 @@ if [ $# -gt 0 ]; then
fi
# pass other options to RPM (exclude -v):
LISTRPMARGS=$(drop_args "$*" v)
LISTRPMARGS="$UPLOADARG $(drop_args "$*" v n q)"
}
set_girar_host $1 && shift
......@@ -72,19 +73,16 @@ set_girar_host $1 && shift
parse_cmd_pre_spec "$@"
mygetopts $LISTARGS
# see functions/alt:set_binaryrepo() for BINARYREPONAME
set_binaryrepo $MENV
test -z "$LISTNAMES" && fatal "file not found in '$@'"
if [ "$PKGVENDOR" = "alt" ] ; then
# FIXME: where we was detected MENV?
MDISTR=$MENV
if [ -n "$BINARYREPONAME" ] ; then
MDISTR=$(get_altdistr_mod $BINARYREPONAME)
else
BINARYREPONAME=$(get_altdistr_version $MDISTR)
fi
[ "$MDISTR" = "SS" ] && fatal "It makes no sense to backport to Sisyphus (You need to try with -b $EXAMPLEALTDISTRVERSION)."
# override by defined target version
DISTRVERSION=$(get_altdistr_version $MDISTR)
DISTRVERSION=$BINARYREPO
else
MDISTR=LOCAL
fi
......@@ -104,7 +102,7 @@ if [ "$PKGVENDOR" = "alt" ] && is_gear $SPECDIR ; then
[ -f "$LISTNAMES" ] || fatal "Run with one spec inside gear repo"
# set branch name
USEBRANCH=$BINARYREPONAME
USEBRANCH=$BINARYREPO
SPEC=$LISTNAMES
BPSPEC=$SPEC.$USEBRANCH
......@@ -138,7 +136,7 @@ if [ "$PKGVENDOR" = "alt" ] && is_gear $SPECDIR ; then
# Only one spec supported
cp -f $LISTNAMES $BPSPEC || fatal
docmd $ETERBUILDBIN/rpmbps -b $BINARYREPONAME $BPSPEC || fatal
docmd $ETERBUILDBIN/rpmbps -b $BINARYREPO $BPSPEC || fatal
docmd git checkout $USEBRANCH || fatal "Can't checkout branch $USEBRANCH. Use $BPSPEC manually or remove it."
# TODO: check result message for merge?
......@@ -155,7 +153,7 @@ if [ "$PKGVENDOR" = "alt" ] && is_gear $SPECDIR ; then
#git checkout $CURBRANCH
fatal "Commit error. You are still in $CURBRANCH branch with modified and uncommitted spec file."
fi
docmd $BUILDCOMMAND $LISTRPMARGS $UPLOADARG $SPEC || { git checkout $CURBRANCH ; fatal "Can't build" ; }
docmd $BUILDCOMMAND $MENVARG $LISTRPMARGS $UPLOADARG $SPEC || { git checkout $CURBRANCH ; fatal "Can't build" ; }
docmd git checkout $CURBRANCH
exit $?
fi
......@@ -179,7 +177,7 @@ for i in $LISTBUILT ; do
SPECNAME=$RPMTOPDIR/SPECS/$(spec_by_srpm $i)
test -f "$SPECNAME" || fatal "Spec $SPECNAME is not found"
docmd $ETERBUILDBIN/rpmbps -b $BINARYREPONAME $SPECNAME
docmd $ETERBUILDBIN/rpmbps -b $BINARYREPO $SPECNAME
docmd $BUILDCOMMAND $LISTRPMARGS $UPLOADARG $SPECNAME || fatal "Can't build"
uni_rpmrm $SPECNAME || true
......
......@@ -32,7 +32,7 @@ phelp()
# echog " -q quiet"
echo
echog "Examples:"
echog " $ rpmbps -b p6 - backport spec to p6 form"
echog " $ rpmbps -b $EXAMPLEALTDISTRVERSION - backport spec to $EXAMPLEALTDISTRVERSION form"
}
# FIXME: has difference between
......@@ -57,6 +57,8 @@ LISTRPMARGS=$(drop_args "$*" v)
parse_cmd_pre_spec "$@"
mygetopts $LISTARGS
# see functions/alt:set_binaryrepo() for BINARYREPONAME
set_binaryrepo $MENV
# TODO
SPECNAME="$LISTNAMES"
......@@ -64,10 +66,9 @@ test -f "$SPECNAME" || fatal "file '$SPECNAME' is not found"
if [ "$PKGVENDOR" = "alt" ] ; then
MDISTR=$MENV
[ -n "$BINARYREPONAME" ] && MDISTR=$(get_altdistr_mod $BINARYREPONAME)
[ "$MDISTR" = "SS" ] && fatal "It makes no sense to backport to Sisyphus (You need to try with -b $EXAMPLEALTDISTRVERSION)."
# override by defined target version
DISTRVERSION=$(get_altdistr_version $MDISTR)
DISTRVERSION=$BINARYREPO
else
# then ROOTDIR is used?
MDISTR=LOCAL
......
......@@ -63,6 +63,8 @@ set_girar_host $1 && shift
parse_cmd_pre_spec "$@"
mygetopts $LISTARGS
# see functions/alt:set_binaryrepo() for BINARYREPONAME
set_binaryrepo $MENV
[ -n "$LISTNAMES" ] || fatal "Run with exists specs as arg"
......@@ -76,6 +78,8 @@ fi
# FIXME: не обрабатывает два пропускаемых вместе параметра
pack_src_rpm $COMMIT $(drop_args "$LISTRPMARGS" s u i c l f a A)
# TODO: use gear --hasher directly, drop myhsh
if rhas "$LISTNAMES" spec ; then
set_specdir $LISTNAMES
fi
......
......@@ -65,10 +65,15 @@ set_binaryrepo()
BINARYREPO="$BINARYREPONAME"
MENV="$(get_altdistr_mod $BINARYREPO)"
MENVARG="-$MENV"
# already was in parse_cmd_pre, but call in again for refill with updated $MENV
# fill with updated $MENV
detect_target_env
return
else
# parse MENV
detect_target_env
BINARYREPO=$(get_altdistr_version $MENV)
fi
test -z "$1" && return
BINARYREPO="`get_altdistr_version $1`"
......
......@@ -429,8 +429,6 @@ do
done
LISTNAMES=$(strip_spaces "$LISTNAMES")
LISTARGS=$(strip_spaces "$LISTARGS")
# parse MENV
detect_target_env
[ -n "$VERBOSE" ] && echo "LISTNAMES=$LISTNAMES LISTARGS=$LISTARGS" || :
}
......
......@@ -56,6 +56,7 @@ EXAMPLEALTDISTRVERSION="p7"
CURRENTBRANCHNAME="M70"
# Build for Sisyphus by default
# TODO: REMOVE IT
MENV=SS
[ -n "$DEBUG" ] && HASHERARG="-v $HASHERARG"
......
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