Commit 32f23833 authored by Vitaly Lipatov's avatar Vitaly Lipatov

myhsh: add -e for fast build after -l (lazy cleanup)

parent 12e509b2
...@@ -25,6 +25,7 @@ phelp() ...@@ -25,6 +25,7 @@ phelp()
echo echo
echog "Options:" echog "Options:"
echog " -c build without stuff (without previous built packages)" echog " -c build without stuff (without previous built packages)"
echog " -e build using hsh-rebuild (using chroot precreated with rpmbsh -l)"
echog " -n build src.rpm only" echog " -n build src.rpm only"
echog " -r remove packages from test hasher" echog " -r remove packages from test hasher"
echog " -p print binary packages by built list" echog " -p print binary packages by built list"
...@@ -33,11 +34,12 @@ phelp() ...@@ -33,11 +34,12 @@ phelp()
echog " -b REPONAME binary repository name (p6, t6, c7, p8 and so on)" echog " -b REPONAME binary repository name (p6, t6, c7, p8 and so on)"
} }
while getopts :hab:pnclr opt; do while getopts :hab:epnclr opt; do
case $opt in case $opt in
h) phelp; exit 0;; h) phelp; exit 0;;
p) PRINTBINPKG=1;; p) PRINTBINPKG=1;;
b) BINARYREPONAME=$OPTARG ;; b) BINARYREPONAME=$OPTARG ;;
e) REBUILD=1;;
n) BUILDSRCRPM="--build-srpm-only";; n) BUILDSRCRPM="--build-srpm-only";;
r) REMOVEPKG=1;; r) REMOVEPKG=1;;
a) REPACKAGE="--query-repackage";; a) REPACKAGE="--query-repackage";;
...@@ -125,7 +127,7 @@ prepare_aptconfig ...@@ -125,7 +127,7 @@ prepare_aptconfig
# FIXME: we override config value here? # FIXME: we override config value here?
# TODO: for add $LISTRPMARGS we need skip function for delete "our" params # TODO: for add $LISTRPMARGS we need skip function for delete "our" params
# we do not need check cases for mount points, thanks ldv@ # we do not need check cases for mount points, thanks ldv@
HASHERARG="--no-sisyphus-check=$HASHER_NOCHECK --apt-config=$OURAPTCONF --target $BUILDARCH $HASHERARG" HASHERARG="--no-sisyphus-check=$HASHER_NOCHECK --target $BUILDARCH $HASHERARG"
HASHERARG="--mountpoints=/proc,/dev/pts $HASHERARG $REPACKAGE $BUILDSRCRPM" HASHERARG="--mountpoints=/proc,/dev/pts $HASHERARG $REPACKAGE $BUILDSRCRPM"
BUILDARGS="" BUILDARGS=""
...@@ -140,11 +142,16 @@ do ...@@ -140,11 +142,16 @@ do
LOGFILE="$LOGDIR/$(basename $(basename $i .src.rpm) .tar)$MENVARG.log" LOGFILE="$LOGDIR/$(basename $(basename $i .src.rpm) .tar)$MENVARG.log"
echo "Build in hasher ($MENV) in $HASHERDIR dir" >$LOGFILE echo "Build in hasher ($MENV) in $HASHERDIR dir" >$LOGFILE
rm -f $LOGFILE.ok rm -f $LOGFILE.ok
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)"
if [ -n "$REBUILD" ] ; then
# Note: hasher is already use renice for low priority # Note: hasher is already use renice for low priority
showcmd $HSH $HASHERARG --build-args "$BUILDARGS" -- $HASHERDIR $i showcmd $HSH-rebuild $HASHERARG -- $HASHERDIR $i
($HSH $HASHERARG --build-args "$BUILDARGS" -- $HASHERDIR $i 2>&1 && touch $LOGFILE.ok) | tee -a $LOGFILE | colorify ($HSH-rebuild $HASHERARG -- $HASHERDIR $i 2>&1 && touch $LOGFILE.ok) | tee -a $LOGFILE | colorify
else
# Note: hasher is already use renice for low priority
showcmd $HSH $HASHERARG --apt-config=$OURAPTCONF --build-args "$BUILDARGS" -- $HASHERDIR $i
($HSH $HASHERARG --apt-config=$OURAPTCONF --build-args "$BUILDARGS" -- $HASHERDIR $i 2>&1 && touch $LOGFILE.ok) | tee -a $LOGFILE | colorify
fi
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.ok ] ; then if [ ! -f $LOGFILE.ok ] ; then
RESULT=1 RESULT=1
......
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