diff options
author | Achim Gottinger <achim@gentoo.org> | 2000-11-19 12:17:29 +0000 |
---|---|---|
committer | Achim Gottinger <achim@gentoo.org> | 2000-11-19 12:17:29 +0000 |
commit | adcad8ef877d79c81791fb3f4699ea0133d92c26 (patch) | |
tree | 05382252f0b479ab5ef9d3e39c6d83020898d733 /autocompile.sh | |
parent | *** empty log message *** (diff) | |
download | gentoo-2-adcad8ef877d79c81791fb3f4699ea0133d92c26.tar.gz gentoo-2-adcad8ef877d79c81791fb3f4699ea0133d92c26.tar.bz2 gentoo-2-adcad8ef877d79c81791fb3f4699ea0133d92c26.zip |
Dependencies stuff
Diffstat (limited to 'autocompile.sh')
-rwxr-xr-x | autocompile.sh | 129 |
1 files changed, 46 insertions, 83 deletions
diff --git a/autocompile.sh b/autocompile.sh index 23c9b1b87cb4..fb4cf5a7daab 100755 --- a/autocompile.sh +++ b/autocompile.sh @@ -3,10 +3,33 @@ C_NORMAL=$'\033[0m' C_HILITE=$'\e[36;01m' -C_END=$'\e[A\e[73G' +C_END=$'\e[A\e[68G' C_OK=$'\e[32m' C_NO=$'\e[31m' PORTDIR=/usr/portage +LOGDIR=$ROOT/tmp/portage-log +STEPS="check fetch clean unpack compile install qmerge clean" + +do_step() { + + echo "$C_END $C_HILITE " + echo "$C_END $C_HILITE [$1] " + ebuild $myd $1 &> $myl/$1 + mye=$? + + if [ -f $LOGDIR/$1 ] + then + cp $LOGDIR/$1 /tmp/failed + grep -v "$i" /tmp/failed > $LOGDIR/$1 + fi + + if [ $mye -ne 0 ] + then + echo "$C_END $C_HILITE " + echo "$C_END $C_NO [$1] " + echo $i >> $LOGDIR/$1 + fi +} if [ -z "${ROOT}" ] then @@ -14,13 +37,6 @@ then exit 1 fi -if [ -n "`ls ${ROOT}`" ] -then - echo "$C_HILITE>>>$C_NORMAL Cleaning ${ROOT}..." - rm -r ${ROOT}/* -fi - -echo "$C_HILITE>>>$C_NORMAL Reading configuration..." mylist=${PORTDIR}/gentoo-x86/current-packages if [ -f "${1}" ] @@ -28,18 +44,12 @@ then mylist=${1} fi -echo "$C_HILITE>>>$C_NORMAL Using ${mylist}" - mypackages="`grep -v "\#.*" $mylist`" -if [ -d "/tmp/portage-log" ] -then - rm -r /tmp/portage-log -fi -mkdir /tmp/portage-log +mkdir -p $ROOT/tmp/portage-log -echo "$C_HILITE>>>$C_NORMAL Building ..." +echo "$C_HILITE>>>$C_NORMAL Building from ${mylist}..." for i in $mypackages do @@ -57,79 +67,32 @@ do if [ -f "$myd" ] then - echo "$C_NORMAL $myp ($myc)" - myl="/tmp/portage-log/$myc/$myp/" - install -d $myl - - # Check dependencies - echo "$C_END $C_HILITE [CHECK] " - ebuild $myd check &> $myl/check - mye=$? - if [ $mye -ne 0 ] + # Check if installed + if [ -d ${ROOT}var/db/pkg/$myc/$myp ] then - echo "$C_END $C_NO [CHECK] " - echo $myd > /tmp/portage/check-failed - continue - fi - - # Clean - echo "$C_END $C_HILITE [CLEAN] " - ebuild $myd clean &> $myl/clean - mye=$? - if [ $mye -ne 0 ] - then - echo "$C_END $C_NO [CLEAN] " - echo $myd > /tmp/portage/clean-failed continue fi - # Unpack - echo "$C_END $C_HILITE [UNPACK] " - ebuild $myd unpack &> $myl/unpack - mye=$? - if [ $mye -ne 0 ] - then - echo "$C_END $C_NO [UNPACK] " - echo $myd > /tmp/portage/unpack-failed - continue - fi - - # Compile - echo "$C_END $C_HILITE [COMPILE]" - ebuild $myd compile &> $myl/compile - mye=$? - if [ $mye -ne 0 ] - then - echo "$C_END $C_NO [COMPILE]" - echo $myd > /tmp/portage/compile-failed - continue + echo "$C_NORMAL$myp ($myc)" + + myl="$LOGDIR/$myc/$myp/" + mkdir -p $myl + + for j in ${STEPS} + do + mye=0 + do_step $j + if [ $mye -ne 0 ] + then + break + fi + done + if [ $mye -eq 0 ] + then + echo "$C_END $C_OK [OK] " fi - - # Install - echo "$C_END $C_HILITE [INSTALL]" - ebuild $myd install &> $myl/install - mye=$? - if [ $mye -ne 0 ] - then - echo "$C_END $C_NO [INSTALL]" - echo $myd > /tmp/portage/install-failed - continue - fi - - # Merge - echo "$C_END $C_HILITE [MERGE] " - ebuild $myd qmerge &> $myl/merge - mye=$? - if [ $mye -ne 0 ] - then - echo "$C_END $C_NO [MERGE] " - echo $myd > /tmp/portage/merge-failed - continue - fi - - echo "$C_END $C_OK [OK] " - + else echo "!!! $myd does not exists !" fi |