From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.54) id 1FRVen-000722-78 for garchives@archives.gentoo.org; Thu, 06 Apr 2006 14:40:21 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.6/8.13.5) with SMTP id k36EdBdx026333; Thu, 6 Apr 2006 14:39:11 GMT Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by robin.gentoo.org (8.13.6/8.13.5) with ESMTP id k36EZWqT013567 for ; Thu, 6 Apr 2006 14:35:32 GMT Received: from frontend2.internal (frontend2.internal [10.202.2.151]) by frontend1.messagingengine.com (Postfix) with ESMTP id D2E80D4771D for ; Thu, 6 Apr 2006 10:35:30 -0400 (EDT) Received: from frontend3.messagingengine.com ([10.202.2.152]) by frontend2.internal (MEProxy); Thu, 06 Apr 2006 10:35:19 -0400 X-Sasl-enc: YH6Nxvt6Zl8aQd2lHTA0fSP90IOG7wyKk57o4HnIkB9l 1144334119 Received: from blackwidow (pool-71-96-68-98.dfw.dsl-w.verizon.net [71.96.68.98]) by www.fastmail.fm (Postfix) with ESMTP id 040622B61 for ; Thu, 6 Apr 2006 10:35:18 -0400 (EDT) Subject: Re: [gentoo-dev] emerge resume list From: "Albert W. Hopkins" To: gentoo-dev@lists.gentoo.org In-Reply-To: References: Content-Type: multipart/mixed; boundary="=-qr9JEkrOZtk9+BcWI23p" Organization: Gentoo Foundation Date: Thu, 06 Apr 2006 09:35:29 -0500 Message-Id: <1144334129.29670.3.camel@blackwidow> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.6.0 X-Archives-Salt: 1a23a2f4-7751-45bc-bd0e-d9ac1bd32696 X-Archives-Hash: 52963435f86279399c9c3f126b421588 --=-qr9JEkrOZtk9+BcWI23p Content-Type: text/plain Content-Transfer-Encoding: 7bit On Thu, 2006-04-06 at 13:52 +1000, evader wrote: > Hi, > > I'm not sure if this is the correct list to send this too, but it is the > only gentoo one I am currently subscribed to. > > When I do an emerge -e world where is the list of files to be merged > stored? For example if I break an emerge, and want to resume later from a > different position, can I edit the packages to be emerged list so I don't > have to do emerge --resume --skipfirst constantly? I have a script (attached) that, more or less does the --skipfirst automatically. You may need to change it to suit your tastes. -m --=-qr9JEkrOZtk9+BcWI23p Content-Disposition: attachment; filename=emptytree Content-Type: application/x-shellscript; name=emptytree Content-Transfer-Encoding: 7bit #!/bin/sh ETLOG=/var/log/emptytree.log PORTAGE_TMPDIR=/var/tmp [ -e /etc/portage/bashrc ] && . /etc/portage/bashrc log () { echo `date`:$* >> $ETLOG } report_time () { endtime=`cat /proc/uptime |cut -d" " -f1 |cut -d. -f1` starttime=$1 time=`expr $endtime - $starttime` hours=`expr $time / 3600` left=`expr $time - 3600 \* $hours` minutes=`expr $left / 60` seconds=`expr $left - 60 \* $minutes` log `printf "END:Completed in %sh %02d:%02d" $hours $minutes $seconds` } kill_children () { local children=`ps h -o pid --ppid $1` local child for child in $children; do kill_children $child done #ps h $1 2> /dev/null kill $1 2> /dev/null } starttime=`cat /proc/uptime |cut -d" " -f1 |cut -d. -f1` if [ "$1" == "kill" ] ; then pid=`fgrep :BEGIN: ${ETLOG} |cut -d: -f5` if ! grep -q emptytree /proc/$pid/cmdline 2>/dev/null ; then pid=`fgrep :RESUME: ${ETLOG} |cut -d: -f5` if ! grep -q emptytree /proc/$pid/cmdline 2>/dev/null ; then echo "emptytree does not appear to be running." > /dev/stderr exit 1 fi fi kill_children $pid log "KILLED:$pid" exit 0 fi if [ "$1" == "resume" ] ; then log "RESUME:$$" starttime=`fgrep :BEGIN: ${ETLOG} |cut -d: -f6` if /usr/bin/emerge --resume; then log "Completed" exit 0 fi else [ -n "$CCACHE_DIR" ] && rm -rf "$CCACHE_DIR"/* rm -f $ETLOG log "BEGIN:$$:$starttime" if /usr/bin/emerge --emptytree world ; then report_time $starttime exit 0 fi fi # something failed, log it package=$(tail -n 2 /var/log/emerge.log |sed -ne '1p' |sed -e 's/^.* (\(.*\)::.*/\1/') log "FAILED:${package}" # continue while ! /usr/bin/emerge --resume --skipfirst ; do package=$(tail -n 2 /var/log/emerge.log |sed -ne '1p' |sed -e 's/^.* (\(.*\)::.*/\1/') log "FAILED:${package}" rm -rf $PORTAGE_TMPDIR/portage done log "END:$$" # sometimes a package will fail in emptytree yet pass if you emerge it # individually. Moreover, if a package did fail, we want to trap it's # error messages failures=`fgrep ":FAILED:" ${ETLOG} |cut -d: -f5` log "REMERGE:Attempting to emerge failed packages individually" rm -rf $PORTAGE_TMPDIR/portage for failure in ${failures}; do log "REMERGE:${failure}:" MAKEOPTS="" /usr/bin/emerge --oneshot "=${failure}" 2>> ${ETLOG} && \ log "REMERGE:${failure}:Completed successfully" done report_time $starttime exit 0 --=-qr9JEkrOZtk9+BcWI23p-- -- gentoo-dev@gentoo.org mailing list