Commit 7c210e66 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmbph: skip merge and spec forming if

parent d9fc8b63
...@@ -44,6 +44,7 @@ phelp() ...@@ -44,6 +44,7 @@ phelp()
# echog " -m - send result via e-mail" # echog " -m - send result via e-mail"
} }
FORCE=
PASSEDARGS= PASSEDARGS=
while getopts :hnuaAfvqb: opt; do while getopts :hnuaAfvqb: opt; do
case $opt in case $opt in
...@@ -117,25 +118,33 @@ if [ "$PKGVENDOR" = "alt" ] && is_gear $SPECDIR ; then ...@@ -117,25 +118,33 @@ if [ "$PKGVENDOR" = "alt" ] && is_gear $SPECDIR ; then
#[ -f "$BPSPEC" ] && fatal "File $BPSPEC is already exists, check it and remove" #[ -f "$BPSPEC" ] && fatal "File $BPSPEC is already exists, check it and remove"
cp -f $SPEC $BPSPEC || fatal "Can't copy to $BPSPEC" cp -f $SPEC $BPSPEC || fatal "Can't copy to $BPSPEC"
# backport spec # backport spec
docmd $ETERBUILDBIN/rpmbps -b $BINARYREPO $BPSPEC || fatal docmd $ETERBUILDBIN/rpmbps -b $BINARYREPO $BPSPEC || fatal
# checkout to $USEBRANCH # checkout to $USEBRANCH
checkout_bpbranch checkout_bpbranch
# if version-release from backported spec is already committed
if [ -z "$FORCE" ] && is_last_commit_tag "$(get_version $BPSPEC)-$(get_release $BPSPEC)" ; then
echo "Tag $(get_last_tag) already exists for the last commit, skipping"
# so just skipping
continue
fi
# TODO: check result message for merge? # TODO: check result message for merge?
# Use heads/ against warning: refname 'branch-name' is ambiguous # Use heads/ against warning: refname 'branch-name' is ambiguous
docmd git merge --no-ff heads/$CURBRANCH docmd git merge --no-ff heads/$CURBRANCH
# override spec conflicts # override spec conflicts
mv -f $BPSPEC $SPEC || fatal mv -f $BPSPEC $SPEC || fatal
# FIXME: Ctrl-\ and q will cancelled less with return error code # FIXME: Ctrl-\ and q will cancelled less with return error code
if [ -z "$QUIET" ] && tty -s && ! ( echo "etersoft-build-utils INFO: Please check diff for backported spec:" ; echo "# etersoft-build-utils NOTE: You can press Ctrl-\ before quit for cancel process."; echo ; git diff $USEBRANCH ) | less; then if [ -z "$QUIET" ] && tty -s && ! ( echo "etersoft-build-utils INFO: Please check diff for backported spec:" ; echo "# etersoft-build-utils NOTE: You can press Ctrl-\ before quit for cancel process."; echo ; git diff $USEBRANCH ) | less; then
#git checkout $SPEC $MDISTR #git checkout $SPEC $MDISTR
#git checkout $CURBRANCH #git checkout $CURBRANCH
fatal "Cancelled by user. You are still in $USEBRANCH branch with modified spec." fatal "Cancelled by user. You are still in $USEBRANCH branch with modified spec."
fi fi
docmd git add $SPEC docmd git add $SPEC
if ! git_commit_ignore_nothing -a -m "backported to $USEBRANCH as $(get_version $SPEC)-$(get_release $SPEC) (with rpmbph script)" ; then if ! git_commit_ignore_nothing -a -m "backported to $USEBRANCH as $(get_version $SPEC)-$(get_release $SPEC) (with rpmbph script)" ; then
#git checkout $CURBRANCH #git checkout $CURBRANCH
......
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