Commit cf28c34e authored by Vitaly Lipatov's avatar Vitaly Lipatov

use docmd or showcmd where possible

parent c3e36fee
...@@ -47,7 +47,7 @@ rpmreqs_to_apt() ...@@ -47,7 +47,7 @@ rpmreqs_to_apt()
install_by_requires() install_by_requires()
{ {
local RLIST="$@" local RLIST="$@"
$SUDO apt-get install --no-remove $RLIST docmd $SUDO apt-get install --no-remove $RLIST
local ERROR=$? local ERROR=$?
REQLIST="$RLIST" REQLIST="$RLIST"
if [ "$ERROR" != "0" ] ; then if [ "$ERROR" != "0" ] ; then
...@@ -65,14 +65,14 @@ install_by_requires() ...@@ -65,14 +65,14 @@ install_by_requires()
ALREADYHANDLEDAPT="bash sh apt rpm filesystem alt-gpgkeys glibc-core glibc-locales" ALREADYHANDLEDAPT="bash sh apt rpm filesystem alt-gpgkeys glibc-core glibc-locales"
ALREADYHANDLEDRPM="rpmlib.* rtld libgcc_s\..* libstdc\+\+.* libc\.so.* ld-linux\.so.* libpthread\.so.* librt\.so.*" ALREADYHANDLEDRPM="rpmlib.* rtld libgcc_s\..* libstdc\+\+.* libc\.so.* ld-linux\.so.* libpthread\.so.* librt\.so.*"
install_packages() install_packages()
{ {
local ERROR= local ERROR=
local LIST="$@" local LIST="$@"
test -n "$LIST" || { echog "There is no more packages to install" ; return ; } test -n "$LIST" || { echog "There is no more packages to install" ; return ; }
echo "Install $LIST" docmd $SUDO apt-get install $LIST
$SUDO apt-get install $LIST
ALREADYHANDLEDAPT="$ALREADYHANDLEDAPT $LIST" ALREADYHANDLEDAPT="$ALREADYHANDLEDAPT $LIST"
REQLIST="$(get_requires $LIST)" REQLIST="$(get_requires $LIST)"
REQLIST=$(regexp_exclude_list "$ALREADYHANDLEDRPM" "$REQLIST") REQLIST=$(regexp_exclude_list "$ALREADYHANDLEDRPM" "$REQLIST")
......
...@@ -24,6 +24,7 @@ PROJECTNAME=$(get_gear_name) ...@@ -24,6 +24,7 @@ PROJECTNAME=$(get_gear_name)
[ -n "$PROJECTNAME" ] || fatal "Can't detect project name. Run inside git repo." [ -n "$PROJECTNAME" ] || fatal "Can't detect project name. Run inside git repo."
echo "Create remote $PROJECTNAME repo in $GIRARHOST:" echo "Create remote $PROJECTNAME repo in $GIRARHOST:"
ssh $GIRARHOST git-init-db "$PROJECTNAME.git" docmd ssh $GIRARHOST git-init-db "$PROJECTNAME.git"
echo "Create $GIRARHOST remote repo alias" echo
git remote add $GIRARHOST $GIRARHOST:packages/$PROJECTNAME.git echo "Create $GIRARHOST remote repo alias:"
docmd git remote add $GIRARHOST $GIRARHOST:packages/$PROJECTNAME.git
...@@ -60,10 +60,10 @@ pull_all_branches() ...@@ -60,10 +60,10 @@ pull_all_branches()
local CURRENTBRANCH=$(get_current_branch) local CURRENTBRANCH=$(get_current_branch)
# pull all branches # pull all branches
for i in $(get_branch_list) ; do for i in $(get_branch_list) ; do
git checkout $i || fatal "can't checkout $i" docmd git checkout $i || fatal "can't checkout $i"
git pull --tags $REPO $i docmd git pull --tags $REPO $i
done done
git checkout $CURRENTBRANCH docmd git checkout $CURRENTBRANCH
} }
if [ -n "$ALLBRANCHES" ] ; then if [ -n "$ALLBRANCHES" ] ; then
...@@ -77,16 +77,15 @@ REMOTEBRANCH="$2" ...@@ -77,16 +77,15 @@ REMOTEBRANCH="$2"
[ -n "$REMOTEBRANCH" ] || REMOTEBRANCH=$(get_current_branch) [ -n "$REMOTEBRANCH" ] || REMOTEBRANCH=$(get_current_branch)
if [ -n "$CHECKONLY" ] ; then if [ -n "$CHECKONLY" ] ; then
echocon "Pull repo from $REPO" showcmd git pull --rebase $REPO $REMOTEBRANCH
UPTODATEres=`git pull --rebase $REPO $REMOTEBRANCH 2>&1` UPTODATEres=`git pull --rebase $REPO $REMOTEBRANCH 2>&1`
echocon "$UPTODATEres" echocon "$UPTODATEres"
echo $UPTODATEres | tail -n1 | grep -q "is up to date" echo $UPTODATEres | tail -n1 | grep -q "is up to date"
exit exit
fi fi
echo "Pull repo from $REPO $REMOTEBRANCH" docmd git fetch $REPO || exit
git fetch $REPO || exit docmd git pull $REBASE $REPO $REMOTEBRANCH || exit
git pull $REBASE $REPO $REMOTEBRANCH || exit
# assure we get tags # REWRITE ME: assure we get tags
git pull --tags $REPO $REMOTEBRANCH docmd git pull --tags $REPO $REMOTEBRANCH
...@@ -69,8 +69,8 @@ push_to_remote() ...@@ -69,8 +69,8 @@ push_to_remote()
echo echo
echo "** Push $TEXTBRANCH from $PROJECTNAME.git to $GHOST $TEXTTAG" echo "** Push $TEXTBRANCH from $PROJECTNAME.git to $GHOST $TEXTTAG"
git push $PUSHALL $PUSHFORCE $GHOST $CURRENTBRANCH || return docmd git push $PUSHALL $PUSHFORCE $GHOST $CURRENTBRANCH || return
[ -z "$TAGSALL" ] || git push --tags $GHOST $CURRENTBRANCH [ -z "$TAGSALL" ] || docmd git push --tags $GHOST $CURRENTBRANCH
} }
tune_girarlist() tune_girarlist()
......
...@@ -55,13 +55,13 @@ else ...@@ -55,13 +55,13 @@ else
fi fi
for i in "$@" ; do for i in "$@" ; do
cd $i || fatal "Run in dir contains '$i' dir" docmd cd $i || fatal "Run in dir contains '$i' dir"
echo echo
echo "== Run $RUNCOMMAND in $(pwd)" echo "== Run $RUNCOMMAND in $(pwd)"
$RUNCOMMAND $FORCE || fatal docmd $RUNCOMMAND $FORCE || fatal
cd - cd -
done done
if [ -n "TASKADD" ] ; then if [ -n "TASKADD" ] ; then
ssh $GIRARHOST task run "$TASK" docmd ssh $GIRARHOST task run "$TASK"
fi fi
...@@ -23,4 +23,4 @@ MAKEARG="-j$NPROCS" ...@@ -23,4 +23,4 @@ MAKEARG="-j$NPROCS"
#[ "$(( $NPROCS - $LOADAVG ))" -gt 1 ] || MAKEARG="" #[ "$(( $NPROCS - $LOADAVG ))" -gt 1 ] || MAKEARG=""
#make $MAKEARG "CC=$CC" "CXX=$CXX" "CPP=$CPP" "CXXCPP=$CXXCPP" $@ #make $MAKEARG "CC=$CC" "CXX=$CXX" "CPP=$CPP" "CXXCPP=$CXXCPP" $@
time -p make $MAKEARG $@ docmd time -p make $MAKEARG $@
...@@ -31,6 +31,7 @@ phelp() ...@@ -31,6 +31,7 @@ phelp()
echo echo
echog "Options:" echog "Options:"
echog " -i initialize hasher" echog " -i initialize hasher"
echog " -b REPONAME binary repository name (4.1, 5.0, 5.1 and so on)"
echog " -c cleanup hasher" echog " -c cleanup hasher"
echog " -o log in as root user" echog " -o log in as root user"
echog " -v verbose" echog " -v verbose"
...@@ -42,13 +43,14 @@ phelp() ...@@ -42,13 +43,14 @@ phelp()
echog " -r remote login to hasher" echog " -r remote login to hasher"
} }
while getopts :chitoav opt; do while getopts :chitoavb: opt; do
case $opt in case $opt in
h) phelp; exit 0;; h) phelp; exit 0;;
t) TESTMODE=1 ;; t) TESTMODE=1 ;;
i) INITIALIZE=1 ;; i) INITIALIZE=1 ;;
c) CLEANUP=1 ;; c) CLEANUP=1 ;;
a) AUTOMODE=1 ;; a) AUTOMODE=1 ;;
b) BINARYREPONAME=$OPTARG ;;
r) REMOTE=1 ;; r) REMOTE=1 ;;
v) VERBOSE="-v" ;; v) VERBOSE="-v" ;;
o) ROOTER="--rooter" ;; o) ROOTER="--rooter" ;;
...@@ -69,8 +71,11 @@ LISTRPMARGS=$@ ...@@ -69,8 +71,11 @@ LISTRPMARGS=$@
parse_cmd_pre "$@" -- parse_cmd_pre "$@" --
mygetopts $LISTARGS mygetopts $LISTARGS
# see functions/alt:set_binaryrepo() for BINARYREPONAME
set_binaryrepo $MENV
# export OURAPTCONF with temp. file contains correct path to sources.list # export OURAPTCONF with temp. file contains correct path to sources.list
# use MENV
prepare_aptconfig prepare_aptconfig
HASHERARG="$HASHERARG --apt-config=$OURAPTCONF --target $DEFAULTARCH --with-stuff" HASHERARG="$HASHERARG --apt-config=$OURAPTCONF --target $DEFAULTARCH --with-stuff"
...@@ -90,14 +95,14 @@ fi ...@@ -90,14 +95,14 @@ fi
if [ "$CLEANUP" = "1" ] ; then if [ "$CLEANUP" = "1" ] ; then
echog "Cleanup hasher in $HASHERDIR..." echog "Cleanup hasher in $HASHERDIR..."
$HSH --cleanup-only $HASHERDIR $HASHERARG || fatal "cleanup" docmd $HSH --cleanup-only $HASHERDIR $HASHERARG || fatal "cleanup"
exit exit
fi fi
if [ ! -d $HASHERDIR ] || [ "$INITIALIZE" = "1" ] || [ -n "$AUTOMODE" ]; then if [ ! -d $HASHERDIR ] || [ "$INITIALIZE" = "1" ] || [ -n "$AUTOMODE" ]; then
echog "Initialize $HASHERDIR ..." echog "Initialize $HASHERDIR ..."
mkdir -p $HASHERDIR || fatal "mkdir" mkdir -p $HASHERDIR || fatal "mkdir"
$HSH $VERBOSE $HASHERARG --initroot-only $HASHERDIR || fatal "Cannot initialize hasher" docmd $HSH $VERBOSE $HASHERARG --initroot-only $HASHERDIR || fatal "Cannot initialize hasher"
fi fi
SHELLHASHERARG="--mountpoints=/proc" SHELLHASHERARG="--mountpoints=/proc"
...@@ -119,15 +124,15 @@ if [ -n "$TESTMODE$AUTOMODE" ] ; then ...@@ -119,15 +124,15 @@ if [ -n "$TESTMODE$AUTOMODE" ] ; then
else else
UTILPKG="$UTILPKG etersoft-build-utils" UTILPKG="$UTILPKG etersoft-build-utils"
fi fi
$HSH-install $HASHERDIR --wait-lock $UTILPKG $LISTRPMARGS $LISTNAMES || fatal "Error with install" docmd $HSH-install $HASHERDIR --wait-lock $UTILPKG $LISTRPMARGS $LISTNAMES || fatal "Error with install"
echog "You are in hasher shell" echog "You are in hasher shell"
$HSH-shell $HASHERDIR $SHELLHASHERARG $ROOTER -Y --shell docmd $HSH-shell $HASHERDIR $SHELLHASHERARG $ROOTER -Y --shell
if [ -n "$AUTOMODE" ] ; then if [ -n "$AUTOMODE" ] ; then
# FIXME: do not remove on x86_64 # FIXME: do not remove on x86_64
echo "Remove package for test preun scripts" echo "Remove package for test preun scripts"
$HSH-run --rooter $HASHERDIR -- rpm -e $(drop_pkg_extensions $LISTNAMES) docmd $HSH-run --rooter $HASHERDIR -- rpm -e $(drop_pkg_extensions $LISTNAMES)
echo "Cleanup hasher in $HASHERDIR..." echo "Cleanup hasher in $HASHERDIR..."
$HSH --cleanup-only $HASHERDIR docmd $HSH --cleanup-only $HASHERDIR
fi fi
...@@ -78,6 +78,7 @@ if [ -n "${LISTNAMES/*tar/}" ] ; then ...@@ -78,6 +78,7 @@ if [ -n "${LISTNAMES/*tar/}" ] ; then
fi fi
# export OURAPTCONF with temp. file contains correct path to sources.list # export OURAPTCONF with temp. file contains correct path to sources.list
# use MENV
prepare_aptconfig prepare_aptconfig
# FIXME: we override config value here? # FIXME: we override config value here?
...@@ -101,7 +102,7 @@ do ...@@ -101,7 +102,7 @@ do
echog "Build in hasher: $i (arg: $HASHERARG --build-args \"$BUILDARGS\", distro: $MENV, hasherdir: $HASHERDIR)" echog "Build in hasher: $i (arg: $HASHERARG --build-args \"$BUILDARGS\", distro: $MENV, hasherdir: $HASHERDIR)"
# Note: hasher is already use renice for low priority # Note: hasher is already use renice for low priority
($HSH $HASHERARG --build-args "$BUILDARGS" -- $HASHERDIR $i 2>&1 || touch $LOGFILE.failed) | tee -a $LOGFILE (docmd $HSH $HASHERARG --build-args "$BUILDARGS" -- $HASHERDIR $i 2>&1 || touch $LOGFILE.failed) | tee -a $LOGFILE
test -L $HASHERDIR/BUILD || ln -s chroot/usr/src/RPM/BUILD $HASHERDIR/ test -L $HASHERDIR/BUILD || ln -s chroot/usr/src/RPM/BUILD $HASHERDIR/
if [ -f $LOGFILE.failed ] ; then if [ -f $LOGFILE.failed ] ; then
RESULT=1 RESULT=1
...@@ -134,7 +135,8 @@ if [ "$RESULT" = "0" -a -n "$TESTINSTALL" ] ; then ...@@ -134,7 +135,8 @@ if [ "$RESULT" = "0" -a -n "$TESTINSTALL" ] ; then
test -n "$BINPACKAGES" || fatal "Can't find binary packages for $LASTPACKAGE in `ls -l $HASHERDIR/repo/$DEFAULTARCH/RPMS.hasher`" test -n "$BINPACKAGES" || fatal "Can't find binary packages for $LASTPACKAGE in `ls -l $HASHERDIR/repo/$DEFAULTARCH/RPMS.hasher`"
echo "List: $BINPACKAGES" echo "List: $BINPACKAGES"
echo echo
exec $ETERBUILDBIN/loginhsh -a $MENVARG $BINPACKAGES docmd $ETERBUILDBIN/loginhsh -a $MENVARG $BINPACKAGES
exit
fi fi
exit $RESULT exit $RESULT
...@@ -15,4 +15,4 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then ...@@ -15,4 +15,4 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
fi fi
is_alt && FANCYPERCENT=--fancypercent is_alt && FANCYPERCENT=--fancypercent
$SUDO rpm -Uvh $FANCYPERCENT "$@" docmd $SUDO rpm -Uvh $FANCYPERCENT "$@"
...@@ -37,6 +37,7 @@ if [ "$VENDOR" = "alt" ] ; then ...@@ -37,6 +37,7 @@ if [ "$VENDOR" = "alt" ] ; then
BUILDREQ= BUILDREQ=
# Change release according to alt policy with extensions # Change release according to alt policy with extensions
# General rule: alwars alt(N-1).MM.(N) # General rule: alwars alt(N-1).MM.(N)
showcmd set_release $SPECNAME $(get_txtrelease $SPECNAME)$(decrement_release $BASERELEASE).$MDISTR.$BASERELEASE
set_release $SPECNAME $(get_txtrelease $SPECNAME)$(decrement_release $BASERELEASE).$MDISTR.$BASERELEASE set_release $SPECNAME $(get_txtrelease $SPECNAME)$(decrement_release $BASERELEASE).$MDISTR.$BASERELEASE
ADDDEF="" ADDDEF=""
CLEANTEXT="" CLEANTEXT=""
...@@ -51,6 +52,7 @@ else ...@@ -51,6 +52,7 @@ else
TXTRELEASE=$(get_txtrelease $SPECNAME) TXTRELEASE=$(get_txtrelease $SPECNAME)
# Override release with KORINFTARGETRELEASE if set # Override release with KORINFTARGETRELEASE if set
[ -z "$KORINFTARGETRELEASE" ] || TXTRELEASE=$KORINFTARGETRELEASE [ -z "$KORINFTARGETRELEASE" ] || TXTRELEASE=$KORINFTARGETRELEASE
showcmd set_release $SPECNAME $TXTRELEASE$BASERELEASE$VENDOR
set_release $SPECNAME $TXTRELEASE$BASERELEASE$VENDOR set_release $SPECNAME $TXTRELEASE$BASERELEASE$VENDOR
test -z "$VERBOSE" || echo "Build package with release $TXTRELEASE" test -z "$VERBOSE" || echo "Build package with release $TXTRELEASE"
ADDDEF="%defattr(-, root, root)" ADDDEF="%defattr(-, root, root)"
...@@ -283,16 +285,18 @@ phelp() ...@@ -283,16 +285,18 @@ phelp()
{ {
echog "$Descr" echog "$Descr"
echog "$Usage" echog "$Usage"
echo "Use rpmbph -$CURRENTBRANCHNAME for backport to ALT $CURRENTBRANCHNAME and so on" echo "Usage: rpmbph -$CURRENTBRANCHNAME for backport to ALT $CURRENTBRANCHNAME and so on"
echo
echog "Options:" echog "Options:"
echog " -u - sign and upload after build" # will pass to rpmbs/rpmbsh echog " -u sign and upload after build" # will pass to rpmbs/rpmbsh
echog " -n - do not build in hasher" echog " -n do not build in hasher"
echog " -i - install built packages in test hasher" # will pass to rpmbs/rpmbsh echog " -i install built packages in test hasher" # will pass to rpmbs/rpmbsh
echog " -b REPONAME - binary repository name (4.1, 5.0, 5.1 and so on)" echog " -b REPONAME binary repository name (4.1, 5.0, 5.1 and so on)"
echo
echog "Ext. options:" echog "Ext. options:"
echog " -r - remote build" # will pass to rpmbs/rpmbsh echog " -r remote build" # will pass to rpmbs/rpmbsh
echog " -v - more verbose" echog " -v more verbose"
echog " -q - quiet" echog " -q quiet"
# echog " -m - send result via e-mail" # echog " -m - send result via e-mail"
} }
...@@ -376,14 +380,14 @@ if [ "$VENDOR" = "alt" ] && is_gear $SPECDIR ; then ...@@ -376,14 +380,14 @@ if [ "$VENDOR" = "alt" ] && is_gear $SPECDIR ; then
# Create branch if not exist yet # Create branch if not exist yet
if ! is_exist_branch $USEBRANCH ; then if ! is_exist_branch $USEBRANCH ; then
git branch $USEBRANCH docmd git branch $USEBRANCH
fi fi
cp -f $LISTNAMES $BPSPEC cp -f $LISTNAMES $BPSPEC
altspec_to_local $BPSPEC altspec_to_local $BPSPEC
git checkout $USEBRANCH || fatal "Can't checkout branch $USEBRANCH. Use $BPSPEC manually or remove it." docmd git checkout $USEBRANCH || fatal "Can't checkout branch $USEBRANCH. Use $BPSPEC manually or remove it."
git merge $CURBRANCH docmd git merge $CURBRANCH
mv -f $BPSPEC $SPEC mv -f $BPSPEC $SPEC
# 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
...@@ -391,15 +395,15 @@ if [ "$VENDOR" = "alt" ] && is_gear $SPECDIR ; then ...@@ -391,15 +395,15 @@ if [ "$VENDOR" = "alt" ] && is_gear $SPECDIR ; then
#git checkout $CURBRANCH #git checkout $CURBRANCH
fatal "User cancelled. You are still in $USEBRANCH branch with modified spec" fatal "User cancelled. You are still in $USEBRANCH branch with modified spec"
fi fi
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
fatal "Commit error. You are still in $MDISTR branch with modified and uncommitted spec" fatal "Commit error. You are still in $MDISTR branch with modified and uncommitted spec"
fi fi
[ -n "$NOBUILD" ] && BUILDCOMMAND="$ETERBUILDBIN/rpmbs $GIRARHOST" [ -n "$NOBUILD" ] && BUILDCOMMAND="$ETERBUILDBIN/rpmbs $GIRARHOST"
echo "Run $BUILDCOMMAND" echo "Run $BUILDCOMMAND"
$BUILDCOMMAND $LISTRPMARGS $UPLOADARG $REMOTEBUILD $DISTRARG $SPEC || { git checkout $CURBRANCH ; fatal "Can't build" ; } docmd $BUILDCOMMAND $LISTRPMARGS $UPLOADARG $REMOTEBUILD $DISTRARG $SPEC || { git checkout $CURBRANCH ; fatal "Can't build" ; }
git checkout $CURBRANCH docmd git checkout $CURBRANCH
exit $? exit $?
fi fi
...@@ -421,9 +425,10 @@ for i in $LISTBUILT ; do ...@@ -421,9 +425,10 @@ for i in $LISTBUILT ; do
SPECNAME=$RPMTOPDIR/SPECS/$(spec_by_srpm $i) SPECNAME=$RPMTOPDIR/SPECS/$(spec_by_srpm $i)
test -f "$SPECNAME" || fatal "Spec $SPECNAME is not found" test -f "$SPECNAME" || fatal "Spec $SPECNAME is not found"
showcmd altspec_to_local $SPECNAME
altspec_to_local $SPECNAME altspec_to_local $SPECNAME
$BUILDCOMMAND $LISTRPMARGS $UPLOADARG $REMOTEBUILD $DISTRARG $SPECNAME || fatal "Can't build" docmd $BUILDCOMMAND $LISTRPMARGS $UPLOADARG $REMOTEBUILD $DISTRARG $SPECNAME || fatal "Can't build"
uni_rpmrm $SPECNAME || true uni_rpmrm $SPECNAME || true
done done
...@@ -120,8 +120,8 @@ check_gear_and_tag() ...@@ -120,8 +120,8 @@ check_gear_and_tag()
# needed correct user.name/user.email for get GPG id # needed correct user.name/user.email for get GPG id
pushd $SPECDIR >/dev/null pushd $SPECDIR >/dev/null
# default: <VERSION>-<RELEASE> # default: <VERSION>-<RELEASE>
$GEARCTAG $FORCE || RESULT=1 docmd $GEARCTAG $FORCE || RESULT=1
test -z "$TAG" || git tag -v "$TAG" || fatal "Tag $TAG is missed in repo" test -z "$TAG" || docmd git tag -v "$TAG" || fatal "Tag $TAG is missed in repo"
popd >/dev/null popd >/dev/null
fi fi
return $RESULT return $RESULT
...@@ -153,7 +153,7 @@ rpmbs_copying_built() ...@@ -153,7 +153,7 @@ rpmbs_copying_built()
[ -n "$ETERDESTSRPM" ] || return 0 [ -n "$ETERDESTSRPM" ] || return 0
echog "Moving package(s) in \$ETERDESTSRPM" echog "Moving package(s) in \$ETERDESTSRPM"
if is_ssh_target "$ETERDESTSRPM" ; then if is_ssh_target "$ETERDESTSRPM" ; then
scp $LISTBUILT $ETERDESTSRPM && rm -fv $LISTBUILT || echog "Error during copying" docmd scp $LISTBUILT $ETERDESTSRPM && docmd rm -fv $LISTBUILT || echog "Error during copying"
else else
mkdir -p $ETERDESTSRPM || echog "Error mkdir $ETERDESTSRPM" mkdir -p $ETERDESTSRPM || echog "Error mkdir $ETERDESTSRPM"
chmod ug+rw $LISTBUILT chmod ug+rw $LISTBUILT
...@@ -187,7 +187,7 @@ if [ -n "$SIGNTAG" ] ; then ...@@ -187,7 +187,7 @@ if [ -n "$SIGNTAG" ] ; then
fi fi
if [ -n "$NOSOURCE" ] ; then if [ -n "$NOSOURCE" ] ; then
$RPMBUILD -bs --nosource 0 $LISTNAMES docmd $RPMBUILD -bs --nosource 0 $LISTNAMES
exit $? exit $?
fi fi
...@@ -207,15 +207,15 @@ if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then ...@@ -207,15 +207,15 @@ if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then
pkg_release_check pkg_release_check
TAG=$VERSION-$RELEASE TAG=$VERSION-$RELEASE
check_gear_and_tag "$TAG" # || fatal "Can't make tag" check_gear_and_tag "$TAG" # || fatal "Can't make tag"
$ETERBUILDBIN/gpush $GIRARHOST $FORCE "$TAG" || fatal "gpush failed. Possibly you need to run ginit for create remote repo. Try \$ gpush $GIRARHOST $TAG command separately" docmd $ETERBUILDBIN/gpush $GIRARHOST $FORCE "$TAG" || fatal "gpush failed. Possibly you need to run ginit for create remote repo. Try \$ gpush $GIRARHOST $TAG command separately"
$ETERBUILDBIN/gpush $GIRARHOST $FORCE || fatal "gpush failed" docmd $ETERBUILDBIN/gpush $GIRARHOST $FORCE || fatal "gpush failed"
echo echo
echo "Run build $PROJECTNAME at $GIRARHOST" echo "Run build $PROJECTNAME at $GIRARHOST"
if [ -n "$TASKNUMBER" ] ; then if [ -n "$TASKNUMBER" ] ; then
ssh $GIRARHOST task add $TASKNUMBER repo $PROJECTNAME $TAG 2>&1 | tee $RPMDIR/uploaded.log.tmp docmd ssh $GIRARHOST task add $TASKNUMBER repo $PROJECTNAME $TAG 2>&1 | tee $RPMDIR/uploaded.log.tmp
else else
[ -n "$POCKET" ] && POCKETARG="-p $POCKET" || POCKETARG="" [ -n "$POCKET" ] && POCKETARG="-p $POCKET" || POCKETARG=""
ssh $GIRARHOST build -b $BINARYREPO $POCKETARG $PROJECTNAME $TAG 2>&1 | tee $RPMDIR/uploaded.log.tmp docmd ssh $GIRARHOST build -b $BINARYREPO $POCKETARG $PROJECTNAME $TAG 2>&1 | tee $RPMDIR/uploaded.log.tmp
fi fi
# FIXME: incorporate # FIXME: incorporate
cat $RPMDIR/uploaded.log.tmp | grep task | head -n2 | tail -n1 >> $RPMDIR/uploaded.log cat $RPMDIR/uploaded.log.tmp | grep task | head -n2 | tail -n1 >> $RPMDIR/uploaded.log
...@@ -249,7 +249,7 @@ fi ...@@ -249,7 +249,7 @@ fi
echog "Will try to sign follow packages with GPG: \$LISTBUILT" echog "Will try to sign follow packages with GPG: \$LISTBUILT"
# 1. only rpm command has --addsign 2. do 3 retries # 1. only rpm command has --addsign 2. do 3 retries
rpm --addsign $LISTBUILT || rpm --addsign $LISTBUILT || rpm --addsign $LISTBUILT docmd rpm --addsign $LISTBUILT || docmd rpm --addsign $LISTBUILT || docmd rpm --addsign $LISTBUILT
RET=$? RET=$?
if [ ! "$RET" = "0" ] ; then if [ ! "$RET" = "0" ] ; then
echog "Impossible to sign package. Check your password and try again." echog "Impossible to sign package. Check your password and try again."
...@@ -294,7 +294,7 @@ fi ...@@ -294,7 +294,7 @@ fi
echog "Uploading to $GIRARHOST" echog "Uploading to $GIRARHOST"
check_ssh_key check_ssh_key
$RSYNC -vay --partial --progress --checksum \ docmd $RSYNC -vay --partial --progress --checksum \
-e ssh $LISTBUILT $GIRARHOST: && \ -e ssh $LISTBUILT $GIRARHOST: && \
echo "---------------------" && \ echo "---------------------" && \
echog "All files synced" || fatal "Error during rsync" echog "All files synced" || fatal "Error during rsync"
...@@ -305,12 +305,10 @@ for i in $LISTBUILT ; do ...@@ -305,12 +305,10 @@ for i in $LISTBUILT ; do
done done
if [ -n "$TASKNUMBER" ] ; then if [ -n "$TASKNUMBER" ] ; then
echo "Add $TASKLIST to task $TASKNUMBER" echo "Add $TASKLIST to task $TASKNUMBER"
[ -n "$VERBOSE" ] && echo "...with command ssh $GIRARHOST task add $TASKNUMBER $TASKLIST" docmd ssh $GIRARHOST task add $TASKNUMBER $TASKLIST 2>&1 | tee $RPMDIR/uploaded.log.tmp
ssh $GIRARHOST task add $TASKNUMBER $TASKLIST 2>&1 | tee $RPMDIR/uploaded.log.tmp
else else
echo "Create task for $TASKLIST" echo "Create task for $TASKLIST"
[ -n "$VERBOSE" ] && echo "...with command ssh $GIRARHOST build -b $BINARYREPO $TASKLIST" docmd ssh $GIRARHOST build -b $BINARYREPO $TASKLIST 2>&1 | tee $RPMDIR/uploaded.log.tmp
ssh $GIRARHOST build -b $BINARYREPO $TASKLIST 2>&1 | tee $RPMDIR/uploaded.log.tmp
fi fi
# FIXME: parse and incorporate # FIXME: parse and incorporate
...@@ -340,7 +338,7 @@ for i in $LISTNAMES ; do ...@@ -340,7 +338,7 @@ for i in $LISTNAMES ; do
build_rpms_name $NAME build_rpms_name $NAME
echo -n " $BUILDROOT " echo -n " $BUILDROOT "
if [ -d "$BUILDROOT" ] ; then if [ -d "$BUILDROOT" ] ; then
rm -rf "$BUILDROOT" && echog "DONE" || echog "failed" docmd rm -rf "$BUILDROOT" && echog "DONE" || echog "failed"
else else
echog "missed" echog "missed"
fi fi
......
...@@ -92,7 +92,7 @@ if [ -n "$REMOTEBUILD" ] ; then ...@@ -92,7 +92,7 @@ if [ -n "$REMOTEBUILD" ] ; then
echog "############ Build at build server '$BUILDSERVER' (with $LISTRPMARGS options) ############" echog "############ Build at build server '$BUILDSERVER' (with $LISTRPMARGS options) ############"
echo echo
echog "==== Copying to build server =====" echog "==== Copying to build server ====="
rsync -vay --partial --progress --checksum \ docmd rsync -vay --partial --progress --checksum \
-e ssh $LISTBUILT $BUILDSERVER:$REMOTERPMDIR/SRPMS/ || fatal "Error with rsync" -e ssh $LISTBUILT $BUILDSERVER:$REMOTERPMDIR/SRPMS/ || fatal "Error with rsync"
# TODO: remove after build # TODO: remove after build
ssh -t $BUILDSERVER "cd $REMOTERPMDIR/SRPMS && time myhsh $MENVARG $LISTRPMARGS $LISTSRPM" ssh -t $BUILDSERVER "cd $REMOTERPMDIR/SRPMS && time myhsh $MENVARG $LISTRPMARGS $LISTSRPM"
...@@ -101,7 +101,7 @@ if [ -n "$REMOTEBUILD" ] ; then ...@@ -101,7 +101,7 @@ if [ -n "$REMOTEBUILD" ] ; then
echo "-------------------------------" echo "-------------------------------"
test "$RESULT" = "0" && echog "It was remote build at $BUILDSERVER" || echog "There is error during remote build at $BUILDSERVER" test "$RESULT" = "0" && echog "It was remote build at $BUILDSERVER" || echog "There is error during remote build at $BUILDSERVER"
else else
time $ETERBUILDBIN/myhsh $MENVARG $LISTRPMARGS $LISTBUILT docmd time $ETERBUILDBIN/myhsh $MENVARG $LISTRPMARGS $LISTBUILT
RESULT=$? RESULT=$?
# remove generated src.rpm # remove generated src.rpm
for i in $LISTBUILT ; do for i in $LISTBUILT ; do
...@@ -121,5 +121,5 @@ fi ...@@ -121,5 +121,5 @@ fi
is_gear $SPECDIR && TSKLIST=$LISTNAMES || TSKLIST=$LISTBUILT is_gear $SPECDIR && TSKLIST=$LISTNAMES || TSKLIST=$LISTBUILT
exec $ETERBUILDBIN/rpmbs $GIRARHOST $MENVARG $RPMBSARGS $TSKLIST docmd $ETERBUILDBIN/rpmbs $GIRARHOST $MENVARG $RPMBSARGS $TSKLIST
...@@ -21,11 +21,11 @@ show_bugs() ...@@ -21,11 +21,11 @@ show_bugs()
{ {
URL=$1 URL=$1
if [ -z "$TEXT" ] ; then if [ -z "$TEXT" ] ; then
echog "Opening URL '$URL' in browser $BROWSER" #echog "Opening URL '$URL' in browser $BROWSER"
$BROWSER $URL & docmd $BROWSER $URL &
else else
echo "@Fetching from '$URL'..." #echo "@Fetching from '$URL'..."
$BROWSER -dump -no-numbering -no-references -dump-width $COLUMNS $URL docmd $BROWSER -dump -no-numbering -no-references -dump-width $COLUMNS $URL
fi fi
} }
...@@ -42,8 +42,9 @@ show_bugbyid() ...@@ -42,8 +42,9 @@ show_bugbyid()
if [ "$1" = "-h" ]; then if [ "$1" = "-h" ]; then
echog "rpmbugs - open bugs in BROWSER" echog "rpmbugs - open bugs in BROWSER"
echog "rpmbugs [-t] spec | bug number | package name | -qf command_name | /path/to/file" echog "rpmbugs [-t] spec | bug number | package name | -qf command_name | /path/to/file"
echo
echog "Options:" echog "Options:"
echog " -t - list in text console" echog " -t list in text console"
exit 0 exit 0
fi fi
......
...@@ -232,8 +232,8 @@ if [ -n "$INSTALLBINARY" ] ; then ...@@ -232,8 +232,8 @@ if [ -n "$INSTALLBINARY" ] ; then
pack_src_rpm --commit $LISTRPMARGS pack_src_rpm --commit $LISTRPMARGS
LISTPKG=$(rpmquery --requires -p $LISTBUILT | clean_pkgreq | sed -e "s|rpm-build-altlinux-compat||g") LISTPKG=$(rpmquery --requires -p $LISTBUILT | clean_pkgreq | sed -e "s|rpm-build-altlinux-compat||g")
CMD=$(get_install_package_command `$DISTRVENDOR -d` interactive) CMD=$(get_install_package_command `$DISTRVENDOR -d` interactive)
echog "Running $SUDO $CMD $LISTPKG" docmd $SUDO $CMD $LISTPKG
exec $SUDO $CMD $LISTPKG exit
fi fi
# TODO: do gpull -a for get all branches? # TODO: do gpull -a for get all branches?
...@@ -244,13 +244,13 @@ get_all_remote_branches() ...@@ -244,13 +244,13 @@ get_all_remote_branches()
for i in $(git branch -a | grep -v "/HEAD" | grep "remotes/origin/") ; do for i in $(git branch -a | grep -v "/HEAD" | grep "remotes/origin/") ; do
local BRANCHNAME=$(echo $i | sed -e "s|remotes.*/||g") local BRANCHNAME=$(echo $i | sed -e "s|remotes.*/||g")
if is_exist_branch $BRANCHNAME ; then if is_exist_branch $BRANCHNAME ; then
git checkout $BRANCHNAME || fatal "can't checkout $BRANCHNAME" docmd git checkout $BRANCHNAME || fatal "can't checkout $BRANCHNAME"
git pull origin $BRANCHNAME docmd git pull origin $BRANCHNAME
else else
git checkout -b $(echo $i | sed -e "s|remotes.*/||g") $i docmd git checkout -b $(echo $i | sed -e "s|remotes.*/||g") $i
fi fi
done done
git checkout sisyphus || git checkout master || git checkout $CURRENTBRANCH docmd git checkout sisyphus || docmd git checkout master || docmd git checkout $CURRENTBRANCH
} }
has_ssh_access() has_ssh_access()
...@@ -263,11 +263,9 @@ git_clone() ...@@ -263,11 +263,9 @@ git_clone()
local RREPO="$1" local RREPO="$1"
# Test if ssh access is available # Test if ssh access is available
if [ -z "$PUBLICACCESS" ] && has_ssh_access ; then if [ -z "$PUBLICACCESS" ] && has_ssh_access ; then
echo "Clone from $GIRARHOST:$RREPO ..." docmd git clone $GIRARHOST:$RREPO
git clone $GIRARHOST:$RREPO
else else
echo "Clone from $GIRARURL/$RREPO ..." docmd git clone $GIRARURL/$RREPO
git clone $GIRARURL/$RREPO
fi fi
} }
...@@ -283,32 +281,32 @@ if [ -n "$CLONEGIT" ] ; then ...@@ -283,32 +281,32 @@ if [ -n "$CLONEGIT" ] ; then
RREPO="/gears/$REPOPATH" RREPO="/gears/$REPOPATH"
if [ -z "$MIGRATEGIRAR" ] ; then if [ -z "$MIGRATEGIRAR" ] ; then
if ! git_clone $RREPO ; then if ! docmd git_clone $RREPO ; then
# http://git.altlinux.org/srpms/N/NAME.git # http://git.altlinux.org/srpms/N/NAME.git
RREPO="/srpms/$REPOPATH" RREPO="/srpms/$REPOPATH"
git_clone $RREPO || fatal "Can't clone $RREPO." docmd git_clone $RREPO || fatal "Can't clone $RREPO."
fi fi
else else
[ -z "$PUBLICACCESS" ] || fatal "Can't remote clone via public access" [ -z "$PUBLICACCESS" ] || fatal "Can't remote clone via public access"
if exist_git_repo $RREPO ; then if exist_git_repo $RREPO ; then
echo "Remote clone from $RREPO ..." echo "Remote clone from $RREPO ..."
ssh $GIRARHOST clone $RREPO packages/$PKGNAME.git || warning "Can't remote clone." docmd ssh $GIRARHOST clone $RREPO packages/$PKGNAME.git || warning "Can't remote clone."
else else
# http://git.altlinux.org/srpms/N/NAME.git # http://git.altlinux.org/srpms/N/NAME.git
RREPO="/srpms/$REPOPATH" RREPO="/srpms/$REPOPATH"
if exist_git_repo $RREPO ; then if exist_git_repo $RREPO ; then
echo "Remote clone from $RREPO ..." echo "Remote clone from $RREPO ..."
ssh $GIRARHOST clone $RREPO packages/$PKGNAME.git || warning "Can't remote clone." docmd ssh $GIRARHOST clone $RREPO packages/$PKGNAME.git || warning "Can't remote clone."
else else
fatal "$PKGNAME does not exists in /gears or /srpms, can't clone" fatal "$PKGNAME does not exists in /gears or /srpms, can't clone"
fi fi
fi fi
git clone $GIRARHOST:packages/$PKGNAME.git docmd git clone $GIRARHOST:packages/$PKGNAME.git
if cd $PKGNAME ; then if cd $PKGNAME ; then
# add remotes # add remotes
git remote rename origin $GIRARHOST && git remote add origin $GIRARHOST:$RREPO docmd git remote rename origin $GIRARHOST && git remote add origin $GIRARHOST:$RREPO
cd - >/dev/null cd - >/dev/null
fi fi
fi fi
...@@ -336,14 +334,14 @@ if [ -n "$MIGRATEGIRAR" ] ; then ...@@ -336,14 +334,14 @@ if [ -n "$MIGRATEGIRAR" ] ; then
echo "Create gear repo $BASENAME from $PKGNAME in $GITREPODIR" echo "Create gear repo $BASENAME from $PKGNAME in $GITREPODIR"
[ -n "$GITREPODIR" ] || GITREPODIR=$(pwd) [ -n "$GITREPODIR" ] || GITREPODIR=$(pwd)
GEARDIR=$GITREPODIR/$BASENAME GEARDIR=$GITREPODIR/$BASENAME
test -d "$GEARDIR" && fatal "repo $GEARDIR already exits" test -d "$GEARDIR" && fatal "repo $GEARDIR already exists"
mkdir -p "$GEARDIR" || fatal "can't create dir $GEARDIR" docmd mkdir -p "$GEARDIR" || fatal "can't create dir $GEARDIR"
cd $GEARDIR || fatal "can't cd to $GEARDIR" docmd cd $GEARDIR || fatal "can't cd to $GEARDIR"
git init-db || fatal "can't init db" docmd git init-db || fatal "can't init db"
gear-srpmimport $PKGNAME || fatal "can't import srpm $PKGNAME" docmd gear-srpmimport $PKGNAME || fatal "can't import srpm $PKGNAME"
# remove src.rpm only if it was generated from spec # remove src.rpm only if it was generated from spec
[ -z ${INFILE/*rpm/} ] || rm -vf $PKGNAME [ -z ${INFILE/*rpm/} ] || rm -vf $PKGNAME
rpmcs docmd rpmcs
done done
exit 0 exit 0
fi fi
...@@ -385,7 +383,7 @@ if [ -n "$CHECKONLINE" ] ; then ...@@ -385,7 +383,7 @@ if [ -n "$CHECKONLINE" ] ; then
set_binaryrepo $MENV set_binaryrepo $MENV
echo -n "ACL list for $GIRARHOST $BINARYREPO: " echo -n "ACL list for $GIRARHOST $BINARYREPO: "
ssh $GIRARHOST acl $BINARYREPO $PKGNAME show docmd ssh $GIRARHOST acl $BINARYREPO $PKGNAME show
RET="MISSED" RET="MISSED"
if [ -n "$SRCRPM" ] ; then if [ -n "$SRCRPM" ] ; then
RSYNCPATH=$(get_rsync_path $GIRARHOST $BINARYREPO) RSYNCPATH=$(get_rsync_path $GIRARHOST $BINARYREPO)
...@@ -396,14 +394,14 @@ if [ -n "$CHECKONLINE" ] ; then ...@@ -396,14 +394,14 @@ if [ -n "$CHECKONLINE" ] ; then
else else
# upstream version difference, just printout list # upstream version difference, just printout list
RSYNCPATH=$(get_rsync_path $GIRARHOST $BINARYREPO) RSYNCPATH=$(get_rsync_path $GIRARHOST $BINARYREPO)
$RSYNC -n "$RSYNCPATH/files/SRPMS/$PKGNAME-[0-9]*" 2>/dev/null | grep $PKGNAME || echo "Package $PKGNAME is missed" docmd $RSYNC -n "$RSYNCPATH/files/SRPMS/$PKGNAME-[0-9]*" 2>/dev/null | grep $PKGNAME || echo "Package $PKGNAME is missed"
echo "Local package $SRCRPM differs from the latest version from $RSYNCPATH" echo "Local package $SRCRPM differs from the latest version from $RSYNCPATH"
fi fi
else else
SRCRPM="$PKGNAME-[0-9]*" SRCRPM="$PKGNAME-[0-9]*"
RSYNCPATH=$(get_rsync_path $GIRARHOST $BINARYREPO) RSYNCPATH=$(get_rsync_path $GIRARHOST $BINARYREPO)
echog "Checking '$SRCRPM' in '$RSYNCPATH' ..." echog "Checking '$SRCRPM' in '$RSYNCPATH' ..."
$RSYNC -n $RSYNCPATH/files/SRPMS/$SRCRPM 2>/dev/null | grep $PKGNAME docmd $RSYNC -n $RSYNCPATH/files/SRPMS/$SRCRPM 2>/dev/null | grep $PKGNAME
echo "Package '$PKGNAME' is not installed locally" echo "Package '$PKGNAME' is not installed locally"
fi fi
......
...@@ -60,7 +60,7 @@ get_archive() ...@@ -60,7 +60,7 @@ get_archive()
URL=${GETSOURCE/.bz2/} URL=${GETSOURCE/.bz2/}
URL=${URL/.tar/} URL=${URL/.tar/}
WEXT=`basename "$URL"` WEXT=`basename "$URL"`
[ -n "$FORCEDOWNLOAD" ] && rm -f "$WEXT.$1" [ -n "$FORCEDOWNLOAD" ] && docmd rm -f "$WEXT.$1"
test -f "$WEXT.$1" && echog "$WEXT.$1 already exists" && return test -f "$WEXT.$1" && echog "$WEXT.$1 already exists" && return
download_url "$URL.$1" || return download_url "$URL.$1" || return
test -f "$WEXT.$1" || return test -f "$WEXT.$1" || return
...@@ -276,11 +276,11 @@ gear_update_from_tarball() ...@@ -276,11 +276,11 @@ gear_update_from_tarball()
[ -d "$CURNAME" ] || CREATEFLAG=-c [ -d "$CURNAME" ] || CREATEFLAG=-c
# TODO: check tarball ext. for unsupported arch and realize it here or in gear-update # TODO: check tarball ext. for unsupported arch and realize it here or in gear-update
echo "Commit tarball '$TARBALL' to git subdir '$CURNAME'..." echo "Commit tarball '$TARBALL' to git subdir '$CURNAME'..."
if ! gear-update $CREATEFLAG $@ "$TARBALL" "$CURNAME" ; then if ! docmd gear-update $CREATEFLAG $@ "$TARBALL" "$CURNAME" ; then
if gear-update $CREATEFLAG $@ "$TARBALL" "$CURNAME" 2>&1 | grep -q "More than one subdirectory specified" ; then if gear-update $CREATEFLAG $@ "$TARBALL" "$CURNAME" 2>&1 | grep -q "More than one subdirectory specified" ; then
echo "Try unpack as is" echo "Try unpack as is"
CREATEFLAG="$CREATEFLAG -a" CREATEFLAG="$CREATEFLAG -a"
gear-update $CREATEFLAG $@ "$TARBALL" "$CURNAME" && return docmd gear-update $CREATEFLAG $@ "$TARBALL" "$CURNAME" && return
fi fi
else else
return 0 return 0
...@@ -419,15 +419,15 @@ do ...@@ -419,15 +419,15 @@ do
# FIXME: need to clone in git root dir # FIXME: need to clone in git root dir
GITROOT=. GITROOT=.
[ $(basename `pwd`) = ".gear" ] && GITROOT=../ [ $(basename `pwd`) = ".gear" ] && GITROOT=../
git svn clone $GETSOURCESVN $GITROOT docmd git svn clone $GETSOURCESVN $GITROOT
echo "Run svn rebase from $GETSOURCESVN" echo "Run svn rebase from $GETSOURCESVN"
git svn rebase docmd git svn rebase
elif is_gear ; then elif is_gear ; then
CURNAME=$BASENAME CURNAME=$BASENAME
test -d "$CURNAME" || CURNAME=$(get_tarballname "$i") test -d "$CURNAME" || CURNAME=$(get_tarballname "$i")
gear_update_from_tarball "$RPMSOURCEDIR/$FTB" "$CURNAME" $FORCEDOWNLOAD gear_update_from_tarball "$RPMSOURCEDIR/$FTB" "$CURNAME" $FORCEDOWNLOAD
rm -f "$RPMSOURCEDIR/$FTB" rm -f "$RPMSOURCEDIR/$FTB"
git commit -m "just import $FTB with rpmgs script" docmd git commit -m "just import $FTB with rpmgs script"
fi fi
else else
is_gear && echo "Skip tarball committing (run with version or with -f option)." is_gear && echo "Skip tarball committing (run with version or with -f option)."
......
...@@ -63,11 +63,11 @@ export ETERDESTSRPM ...@@ -63,11 +63,11 @@ export ETERDESTSRPM
PREVPATH=$(readlink -m "$ETERDESTSRPM/../../last") PREVPATH=$(readlink -m "$ETERDESTSRPM/../../last")
if [ -n "$ALPHA" ] && [ ! -d "$ETERDESTSRPM" ] && [ -d "$PREVPATH" ] ; then if [ -n "$ALPHA" ] && [ ! -d "$ETERDESTSRPM" ] && [ -d "$PREVPATH" ] ; then
echo "Copying previous target tree from $PREVPATH" echo "Copying previous target tree from $PREVPATH"
cp -alv $PREVPATH $(readlink -m "$ETERDESTSRPM/..") docmd cp -alv $PREVPATH $(readlink -m "$ETERDESTSRPM/..")
fi fi
# just for your information: rpmbs supports ssh-like target # just for your information: rpmbs supports ssh-like target
$ETERBUILDBIN/rpmbs $FORCE -s $SPECNAME || fatal "Can't build SRPMS" docmd $ETERBUILDBIN/rpmbs $FORCE -s $SPECNAME || fatal "Can't build SRPMS"
# if known target and last link already exists # if known target and last link already exists
if [ -n "$ALPHA" ] && [ -L "$ETERDESTSRPM/../../last" ] ; then if [ -n "$ALPHA" ] && [ -L "$ETERDESTSRPM/../../last" ] ; then
......
...@@ -36,7 +36,7 @@ fi ...@@ -36,7 +36,7 @@ fi
test -f "$SPEC" || SPEC=$(get_gear_spec) test -f "$SPEC" || SPEC=$(get_gear_spec)
$ETERBUILDBIN/rpmgs $SPEC $VER || fatal "Error with get source" docmd $ETERBUILDBIN/rpmgs $SPEC $VER || fatal "Error with get source"
add_changelog_helper "- new version $(get_version $SPEC) (with rpmrb script)" $SPEC || echog "Changelog entry already exists" add_changelog_helper "- new version $(get_version $SPEC) (with rpmrb script)" $SPEC || echog "Changelog entry already exists"
if is_gear ; then if is_gear ; then
...@@ -44,5 +44,5 @@ if is_gear ; then ...@@ -44,5 +44,5 @@ if is_gear ; then
git_commit_ignore_nothing $SPEC -m "update spec to new build $(get_version $SPEC) (with rpmrb script)" || exit 1 git_commit_ignore_nothing $SPEC -m "update spec to new build $(get_version $SPEC) (with rpmrb script)" || exit 1
fi fi
$ETERBUILDBIN/rpmbsh $REMOTE -i $SPEC || fatal "Error with build in hasher" docmd $ETERBUILDBIN/rpmbsh $REMOTE -i $SPEC || fatal "Error with build in hasher"
$ETERBUILDBIN/rpmbs $GIRARHOST -u $SPEC || fatal "Error with upload" docmd $ETERBUILDBIN/rpmbs $GIRARHOST -u $SPEC || fatal "Error with upload"
...@@ -62,7 +62,8 @@ set_binaryrepo() ...@@ -62,7 +62,8 @@ set_binaryrepo()
BINARYREPO="sisyphus" BINARYREPO="sisyphus"
if [ -n "$BINARYREPONAME" ] ; then if [ -n "$BINARYREPONAME" ] ; then
BINARYREPO="$BINARYREPONAME" BINARYREPO="$BINARYREPONAME"
MENVARG="-$(get_altdistr_mod $BINARYREPO)" MENV="$(get_altdistr_mod $BINARYREPO)"
MENVARG="-$MENV"
return return
fi fi
test -z "$1" && return test -z "$1" && return
......
...@@ -63,19 +63,21 @@ uni_rpmbuild() ...@@ -63,19 +63,21 @@ uni_rpmbuild()
fi fi
# build package without MENV checking # build package without MENV checking
if true || [ "$MENV" = "SS" ] ; then if true || [ "$MENV" = "SS" ] ; then
showcmd $GEAR $COMMIT $GEARRULES --rpmbuild -- $RPMBUILD "$ONEPARAM" "$TWOPARAM" "$THRPARAM" "$FOURPARAM" "$FIVEPARAM" $@
$NICE $GEAR $COMMIT $GEARRULES --rpmbuild -- $RPMBUILD "$ONEPARAM" "$TWOPARAM" "$THRPARAM" "$FOURPARAM" "$FIVEPARAM" $@ || RET=$? $NICE $GEAR $COMMIT $GEARRULES --rpmbuild -- $RPMBUILD "$ONEPARAM" "$TWOPARAM" "$THRPARAM" "$FOURPARAM" "$FIVEPARAM" $@ || RET=$?
[ -z "$COMMANDAFTER" ] || $COMMANDAFTER [ -z "$COMMANDAFTER" ] || docmd $COMMANDAFTER
else else
fatal "Build backported src.rpm from git is unsupported now" fatal "Build backported src.rpm from git is unsupported now"
# build src.rpm via hasher (on ALT) # build src.rpm via hasher (on ALT)
# $NICE gear-hsh --build-args="-bs" --rpmbuild -- $COMMAND "$ONEPARAM" $@ # $NICE gear-hsh --build-args="-bs" --rpmbuild -- $COMMAND "$ONEPARAM" $@
$NICE $GEAR --hasher -- myhsh --build-prog=$ETERBUILDDIR/functions/rebuild $@ || RET=$? docmd $NICE $GEAR --hasher -- myhsh --build-prog=$ETERBUILDDIR/functions/rebuild $@ || RET=$?
fi fi
else else
mkdir -p $RPMTOPDIR/BUILD $RPMTOPDIR/SRPMS mkdir -p $RPMTOPDIR/BUILD $RPMTOPDIR/SRPMS
show $RPMBUILD "$ONEPARAM" "$TWOPARAM" "$THRPARAM" "$FOURPARAM" "$FIVEPARAM" $@
$NICE $RPMBUILD "$ONEPARAM" "$TWOPARAM" "$THRPARAM" "$FOURPARAM" "$FIVEPARAM" $@ || RET=$? $NICE $RPMBUILD "$ONEPARAM" "$TWOPARAM" "$THRPARAM" "$FOURPARAM" "$FIVEPARAM" $@ || RET=$?
fi fi
[ -n "$VERBOSE" ] && echo "Run $RPMBUILD $ONEPARAM $TWOPARAM $THRPARAM $FOURPARAM $FIVEPARAM $@" || : #[ -n "$VERBOSE" ] && echo "Run $RPMBUILD $ONEPARAM $TWOPARAM $THRPARAM $FOURPARAM $FIVEPARAM $@" || :
return $RET return $RET
} }
...@@ -91,9 +93,11 @@ uni_buildreq() ...@@ -91,9 +93,11 @@ uni_buildreq()
local GEARBUILDREQ=gear-buildreq local GEARBUILDREQ=gear-buildreq
if is_gear $SPECDIR ; then if is_gear $SPECDIR ; then
showcmd $GEARBUILDREQ $BUILDREQPARAM --commit -- "$SPECNAME" $@
$NICE $GEARBUILDREQ $BUILDREQPARAM --commit -- "$SPECNAME" $@ || RET=$? $NICE $GEARBUILDREQ $BUILDREQPARAM --commit -- "$SPECNAME" $@ || RET=$?
else else
$NICE buildreq $BUILDREQPARAM "$SPECNAME" $@ || RET=$? showcmd buildreq $BUILDREQPARAM "$SPECNAME" $@
docmd $NICE buildreq $BUILDREQPARAM "$SPECNAME" $@ || RET=$?
fi fi
return $RET return $RET
} }
...@@ -111,8 +115,8 @@ uni_rpminstall() ...@@ -111,8 +115,8 @@ uni_rpminstall()
# $NICE $GEARBUILDREQ --commit -- $@ || RET=$? # $NICE $GEARBUILDREQ --commit -- $@ || RET=$?
#else #else
echo -n "Install package " echo -n "Install package "
mkdir -p $RPMTOPDIR/SOURCES $RPMTOPDIR/SRPMS $RPMTOPDIR/RPMS docmd mkdir -p $RPMTOPDIR/SOURCES $RPMTOPDIR/SRPMS $RPMTOPDIR/RPMS
rpm -iv "$TWOPARAM" $@ || RET=$? docmd rpm -iv "$TWOPARAM" $@ || RET=$?
#fi #fi
return $RET return $RET
} }
...@@ -126,7 +130,7 @@ uni_rpmrm() ...@@ -126,7 +130,7 @@ uni_rpmrm()
TWOPARAM="--define=_topdir $RPMTOPDIR" TWOPARAM="--define=_topdir $RPMTOPDIR"
fi fi
$RPMBUILD "$TWOPARAM" --rmsource --rmspec --nodeps $@ docmd $RPMBUILD "$TWOPARAM" --rmsource --rmspec --nodeps $@
} }
......
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