public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Neil Bothwick <neil@digimed.co.uk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Howzat!
Date: Wed, 20 Apr 2011 14:33:14 +0100	[thread overview]
Message-ID: <20110420143314.082671c3@zaphod.digimed.co.uk> (raw)
In-Reply-To: <4DAD7B12.6090806@asyr.hopto.org>


[-- Attachment #1.1: Type: text/plain, Size: 1884 bytes --]

On Tue, 19 Apr 2011 15:07:46 +0300, Thanasis wrote:

> > That's the gist of it, although it also emails the output from emerge
> > -pvDN world, so I can see what needs to be done. It runs a few other
> > bits, like glsa-check.
> >
> >  
> Neil, do you mind posting it (after changing any private bits to
> generic)?
> 
Here it is, as an attachment too to avoid screwing up the lines


#!/bin/bash

export PORTAGE_ECLASS_WARNING_ENABLE="0"
WORLD_MERGE="emerge --update --deep --reinstall changed-use --with-bdeps y --verbose @system @world"

[[ -d /etc/portage/presync.d ]] && for s in /etc/portage/presync.d/*[!~]; do
	$s || exit
	done

SYNCED="false"
if [[ ! -f /etc/portage/noautosync ]] && ! mount | grep -q ' /usr/portage type nfs '; then
	SYNCED=""
	for i in {0..12}; do
		echo "$(date): syncing portage"
		emerge --sync && SYNCED="true" && break
		sleep 5m
		done
	fi

if [[ "${SYNCED}" ]]; then
	if [[ "${SYNCED}" == "true" ]]; then
		echo "Portage synced" 1>&2
	else
		echo "Portage not synced" 1>&2
		fi
	TEMPFILE=$(mktemp)
	${WORLD_MERGE} --changelog --pretend >|${TEMPFILE}
	Mail -s "$(hostname): Updated packages" neil <${TEMPFILE}
	rm -f ${TEMPFILE}
else
	echo "Failure syncing portage" >&2
	fi

GLSAs=$(glsa-check --test all 2>/dev/null)
if [[ -n "${GLSAs}" ]]; then
	for GLSA in ${GLSAs}; do
		glsa-check --dump ${GLSA} | grep -B88 Unaffected
		echo -e "\n"
		done | Mail -s "GLSA warnings for $(hostname)" neil
	fi

if [[ -x "$(which eix-update 2>/dev/null)" ]]; then
	eix-update --quiet
	[[ -f /etc/portage/no-eix-remote ]] || LOCAL_LAYMAN=/mnt/portage/layman eix-remote -q update
	fi

for i in /etc/portage/postupdate.d/*[!~]; do
	[[ $i == ${i/\~} ]] && [[ -x $i ]] && $i
	done

exit 0



-- 
Neil Bothwick

Biology is the only science in which multiplication means the same thing
as division.

[-- Attachment #1.2: emerge-update --]
[-- Type: application/octet-stream, Size: 1319 bytes --]

#!/bin/bash

export PORTAGE_ECLASS_WARNING_ENABLE="0"
WORLD_MERGE="emerge --update --deep --reinstall changed-use --with-bdeps y --verbose @system @world"

[[ -d /etc/portage/presync.d ]] && for s in /etc/portage/presync.d/*[!~]; do
	$s || exit
	done

SYNCED="false"
if [[ ! -f /etc/portage/noautosync ]] && ! mount | grep -q ' /usr/portage type nfs '; then
	SYNCED=""
	for i in {0..12}; do
		echo "$(date): syncing portage"
		emerge --sync && SYNCED="true" && break
		sleep 5m
		done
	fi

if [[ "${SYNCED}" ]]; then
	if [[ "${SYNCED}" == "true" ]]; then
		echo "Portage synced" 1>&2
	else
		echo "Portage not synced" 1>&2
		fi
	TEMPFILE=$(mktemp)
	${WORLD_MERGE} --changelog --pretend >|${TEMPFILE}
	Mail -s "$(hostname): Updated packages" neil <${TEMPFILE}
	rm -f ${TEMPFILE}
else
	echo "Failure syncing portage" >&2
	fi

GLSAs=$(glsa-check --test all 2>/dev/null)
if [[ -n "${GLSAs}" ]]; then
	for GLSA in ${GLSAs}; do
		glsa-check --dump ${GLSA} | grep -B88 Unaffected
		echo -e "\n"
		done | Mail -s "GLSA warnings for $(hostname)" neil
	fi

if [[ -x "$(which eix-update 2>/dev/null)" ]]; then
	eix-update --quiet
	[[ -f /etc/portage/no-eix-remote ]] || LOCAL_LAYMAN=/mnt/portage/layman eix-remote -q update
	fi

for i in /etc/portage/postupdate.d/*[!~]; do
	[[ $i == ${i/\~} ]] && [[ -x $i ]] && $i
	done

exit 0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2011-04-20 13:35 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-18  1:28 [gentoo-user] Howzat! Peter Humphrey
2011-04-18  1:44 ` Dale
2011-04-18  4:53   ` Joshua Murphy
2011-04-18  7:52     ` Florian Philipp
2011-04-18  8:12       ` Neil Bothwick
2011-04-18  9:32         ` Florian Philipp
2011-04-19 22:40     ` Kfir Lavi
2011-04-19 22:54       ` Dale
2011-04-20  7:33         ` Joost Roeleveld
2011-04-20  8:42           ` Dale
2011-04-20  9:25             ` Joost Roeleveld
2011-04-20  9:49               ` Pandu Poluan
2011-04-20 10:24                 ` Joost Roeleveld
2011-04-21  5:41                   ` Pandu Poluan
2011-04-21 15:49                     ` Paul Hartman
2011-04-20 12:37               ` Joost Roeleveld
2011-04-20 13:16                 ` Alan McKinnon
2011-04-20 13:41                   ` Joost Roeleveld
2011-04-20 20:06                     ` Alan McKinnon
2011-04-20 21:38                       ` Mick
2011-04-18 11:22   ` Peter Humphrey
2011-04-18 12:44     ` Neil Bothwick
2011-04-18 14:35       ` Peter Humphrey
2011-04-18 14:51         ` Florian Philipp
2011-04-18 15:48           ` Peter Humphrey
2011-04-18 15:59             ` Peter Humphrey
2011-04-18 21:56           ` Neil Bothwick
2011-04-19  5:34             ` Thanasis
2011-04-19  6:57               ` Joost Roeleveld
2011-04-19  8:04                 ` Neil Bothwick
2011-04-19 12:07                   ` Thanasis
2011-04-20 13:33                     ` Neil Bothwick [this message]
2011-04-20 21:23                       ` Thanasis
2011-04-20 22:01                         ` Neil Bothwick
2011-04-21  7:44                           ` Thanasis
2011-04-21  8:03                             ` Neil Bothwick
2011-04-21  8:15                               ` Thanasis
2011-04-21 10:57                               ` Thanasis
2011-04-21 13:26                                 ` Neil Bothwick
2011-04-21 14:45                                   ` Thanasis
2011-04-21 22:09                                     ` Neil Bothwick
2011-04-22  5:05                                       ` Thanasis
2011-04-22  7:14                                         ` Neil Bothwick
2011-04-22  8:12                                           ` Thanasis
2011-04-22 13:00                                             ` Neil Bothwick
2011-04-22 15:26                                               ` Thanasis
2011-04-22 18:46                                                 ` Neil Bothwick
2011-04-21 13:41                       ` Mark Knecht
2011-04-21 22:42                         ` Neil Bothwick
2011-04-22  0:38                           ` Mark Knecht
2011-04-19 12:40                   ` Joost Roeleveld
2011-04-20 10:40                     ` Thanasis

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=20110420143314.082671c3@zaphod.digimed.co.uk \
    --to=neil@digimed.co.uk \
    --cc=gentoo-user@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