public inbox for gentoo-amd64@lists.gentoo.org
 help / color / mirror / Atom feed
From: Roy Wright <royw@cisco.com>
To: gentoo-amd64@lists.gentoo.org
Subject: Re: [gentoo-amd64] backups and world updates
Date: Thu, 28 Jul 2005 13:32:29 -0500	[thread overview]
Message-ID: <42E924BD.1010206@cisco.com> (raw)
In-Reply-To: <1f81f7e005072808137d93cae8@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

Mark wrote:

>Hi Roy, I wasn't able to find it. Can you post your version? This
>sounds like the approach I'd like to take. Thanks!
>  
>
Here it is.  After reading Matt's post, looks like I need to try
dispatch-conf instead of etc-update.  Learn something new
everyday here.  ;-)

Disclaimor, these scripts are starting points.  Customization
is highly recommended.  :-)

Scripts:

/etc/cron.daily/portage.cron
/usr/local/sbin/einfo

Have fun,
Roy


[-- Attachment #2: portage.cron --]
[-- Type: text/plain, Size: 2092 bytes --]

#!/bin/sh
#
# Remove downloads older than 14 days
# Remove directories from /var/tmp/portage older than 2 days
# Remove ._mrg* files left over from dispatch-conf
# Sync the portage tree
# Update the database used by esearch
# See what would be updated and estimate how long
# Depends on cron to mail results to root
#
# Dependencies:
#	>=sys-apps/portage-2.0.51
#	>=app-portage/gentoolkit-0.2.1_pre3
#	app-portage/esearch
#	app-portage/genlop
#	app-admin/tmpwatch

#echo "Portage Tree not Updated"; exit 0

export PATH=$PATH:/usr/sbin
export NOCOLOR="true" 	# Turn off color for "emerge"

echo "Starting portage.cron at: $(date)" >> /var/log/portage.cron.log

#echo "Finding and cleaning older distfiles..."
#tmpwatch --atime --mtime --ctime --verbose 168 /usr/portage/distfiles

echo "Cleaning /var/tmp/portage..."
#tmpwatch --atime --mtime --ctime --verbose 48 --exclude /var/tmp/portage/homedir /var/tmp/portage
tmpwatch --atime --mtime --ctime 48 --exclude /var/tmp/portage/homedir /var/tmp/portage

echo "Cleaning up old merge files from dispatch-conf"
find / -xdev -name "._mrg*" -exec rm {} \;

echo "Running revdep-rebuild"
revdep-rebuild --ignore --pretend --no-color
rm -f /.revdep-rebuild.*

echo "Syncing portage tree..."
emerge --sync 2>> /var/log/portage.cron.log > /dev/null
status=$?

if [ $status -ne 0 ]; then
	echo "Portage sync failed, exiting update."
	exit $status
fi

echo "Running eupdatedb..."
eupdatedb --quiet --nocolor 2> /dev/null

echo "Running update-eix..."
update-eix --quiet

echo "Checking for updates..."
/usr/local/sbin/einfo --update --deep --newuse world
emerge --update --deep --pretend --verbose --nospinner --newuse world > /tmp/emerge.output
emerge --update --deep --fetchonly --quiet --nospinner --newuse world >> /tmp/emerge.output

echo "Estimated time for updates..."
cat /tmp/emerge.output | genlop -n --pretend
rm -f /tmp/emerge.output

echo "Checking Gentoo Linux Security Advisories (GLSA) ..."
for glsa in `glsa-check -t all 2>/dev/null | grep -v GLSA`
do
	glsa-check --pretend $glsa 2>/dev/null
	glsa-check --print $glsa 2>/dev/null
done


[-- Attachment #3: einfo --]
[-- Type: text/plain, Size: 1112 bytes --]

#!/usr/bin/perl

# this script will run emerge with the given command line options plus
# "--pretend".  It will then grep all of the packages to be merged looking
# for einfo, ewarn, and eerror lines to display.
# Thanks to Peter.Ruskin@dsl.pipex.com for the ewarn and error suggestions.

$portage = '/usr/portage';
$emerge = "emerge @ARGV --pretend";

open(EMERGE, "$emerge|") || die "unable to open $emerge\n";
while(<EMERGE>) {
	if(/\[[^\]]+\]\s+(\S+)\/(\S+)\-(\d\S*)\s/) {
		findInfo($1,$2,$3);
	}
}
close(EMERGE);

exit 0;

sub findInfo
{
	local ($package,$name,$ver) = @_;
	local $pkgDir = "$portage/$package/$name";
	local $ebuild = "$pkgDir/$name-$ver.ebuild";
	print "$ebuild\n";
	if(-T $ebuild) {
		open(EBUILD, "<$ebuild") || warn "unable to read $ebuild\n";
		while(<EBUILD>) {
			if(/(einfo.*)$/) {
				print "  $1\n";
			}
                        if(/(ewarn.*)$/) {
                                print "  $1\n";
                        }
                        if(/(eerror.*)$/) {
                                print "  $1\n";
                        }
		}
		close(EBUILD);
	}
	print "\n";
}


  reply	other threads:[~2005-07-28 18:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-28 13:53 [gentoo-amd64] backups and world updates Mark
2005-07-28 14:11 ` Brett Johnson
2005-07-31  3:48   ` [gentoo-amd64] emerge of neverwinter nights fails Mark Creamer
2005-07-31  3:57     ` shimi
2005-07-31  9:24       ` Michal Žeravík
2005-07-31  9:51         ` Peter Humphrey
2005-07-31 17:05           ` phil
2005-07-31 21:39             ` Michal Žeravík
2005-07-31 23:05               ` Mark Creamer
2005-08-01 15:59                 ` Chuck Milam
2005-08-01 16:11                   ` Peter Humphrey
2005-08-01 17:10                     ` Chuck Milam
2005-08-01 20:10                       ` phil
2005-08-01 18:49                     ` phil
2005-07-31  9:25     ` [gentoo-amd64] " Duncan
2005-07-28 14:22 ` [gentoo-amd64] backups and world updates Roy Wright
2005-07-28 15:13   ` Mark
2005-07-28 18:32     ` Roy Wright [this message]
2005-07-28 15:47   ` Matt Randolph
2005-07-28 15:15 ` Matt Randolph
2005-07-29 14:25 ` [gentoo-amd64] " Duncan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42E924BD.1010206@cisco.com \
    --to=royw@cisco.com \
    --cc=gentoo-amd64@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox