summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Gavin <pete@gentoo.org>2001-07-28 15:49:20 +0000
committerPeter Gavin <pete@gentoo.org>2001-07-28 15:49:20 +0000
commit00370f2de9e5825d29ca212d51ed35388567b48d (patch)
treefbd98eac91baf6271f55be3aa165475eae5ce777 /scripts/autocompile.sh
parentapply a patch that makes it work better with autoconf 2.13 (diff)
downloadgentoo-2-00370f2de9e5825d29ca212d51ed35388567b48d.tar.gz
gentoo-2-00370f2de9e5825d29ca212d51ed35388567b48d.tar.bz2
gentoo-2-00370f2de9e5825d29ca212d51ed35388567b48d.zip
bootcd fixups and additions. set USE=bootcd to build these packages
for the installation cd. autoiso.sh is the cd building automation script. (its not nearly complete though)
Diffstat (limited to 'scripts/autocompile.sh')
-rw-r--r--scripts/autocompile.sh135
1 files changed, 135 insertions, 0 deletions
diff --git a/scripts/autocompile.sh b/scripts/autocompile.sh
new file mode 100644
index 000000000000..a8010883f505
--- /dev/null
+++ b/scripts/autocompile.sh
@@ -0,0 +1,135 @@
+#!/bin/sh
+
+# description:
+#
+# ROOT is the root all packages are installed to
+#
+# if CHECK=yes then skip an already installed package
+# if CHECK=package then skip a package if its tbz2 already exists
+#
+# ERRQUIT=no causes the script to keep trying to build packages even
+# when one has failed.
+#
+
+C_NORMAL=$'\033[0m'
+C_HILITE=$'\e[36;01m'
+C_END=$'\e[A\e[68G'
+C_OK=$'\e[32m'
+C_NO=$'\e[31m'
+#eval `/usr/lib/portage/bin/import-settings PORTDIR PKGDIR`
+PORTDIR=/usr/portage
+LOGDIR=${ROOT}/tmp/portage-log
+PKGDIR=/usr/portage/packages
+[ -z "$CHECK" ] && CHECK="yes"
+[ -z "$STEPS" ] && STEPS="check fetch clean compile install qmerge clean"
+[ -z "$ERRQUIT" ] && ERRQUIT="no"
+
+do_step() {
+
+ local tmpd
+ tmpd=`pwd`
+ echo "$C_END $C_HILITE "
+ echo "$C_END $C_HILITE [$1]$C_NORMAL "
+ cd `dirname $myd`
+ ebuild $myf $1 &> $myl/$1
+ mye=$?
+ cd $tmpd
+
+ 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]$C_NORMAL "
+ echo $i >> $LOGDIR/$1
+ [ "${ERRQUIT}" = "yes" ] && exit 1
+ fi
+ return $mye
+}
+
+if [ -z "${ROOT}" ]
+then
+ echo "ROOT not set !"
+ exit 1
+fi
+
+mylist=${PORTDIR}/current-packages
+
+if [ -f "${1}" ]
+then
+ mylist=${1}
+fi
+
+mypackages="`grep -v "\#.*" $mylist`"
+
+install -m1777 -d $ROOT/tmp/portage-log
+
+echo "$C_HILITE>>>$C_NORMAL Building from ${mylist}..."
+for i in $mypackages
+do
+ source /etc/profile
+ # full path
+ myd=${i/.\//$PORTDIR\/}
+
+ # file name
+ myf="`basename $myd`"
+
+ # category
+ myc="`echo $i | sed -e "s:^\(.*\).*/.*/.*$:\1:"`"
+
+ # package name
+ myp=${myf%*.ebuild}
+
+ # debugging
+# echo $myp
+
+ if [ -f "$myd" ]
+ then
+
+ # Check if installed
+ if [ "$CHECK" = "yes" ]
+ then
+ if [ -d ${ROOT}/var/db/pkg/$myc/$myp ]
+ then
+ continue
+ fi
+ else
+ if [ "$CHECK" = "package" ]
+ then
+ if [ -f ${PKGDIR}/All/$myp.tbz2 ]
+ then
+ continue
+ fi
+ fi
+ fi
+
+ 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]$C_NORMAL "
+ echo $i >> ${LOGDIR}/ok
+ fi
+
+ else
+ echo "!!! $myd does not exists !"
+ fi
+ env-update &>/dev/null
+
+done