Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 28031 - Automatic Notification of Available Package Updates
Summary: Automatic Notification of Available Package Updates
Status: RESOLVED INVALID
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
: 14642 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-05 21:56 UTC by Stuart Bain
Modified: 2006-01-05 15:08 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Bain 2003-09-05 21:56:32 UTC
The "Additional Information" section of this bug contains a quick, down and
dirty shell script I wrote for automatic notification(s) of available upgrades.
I use it on all my servers so I don't have to go manually checking for updates
every day. I figure if anything, it would be best to include it into gentoolkit
instead of trying to make it a new package. I'm sure there are some improvements
that can be made to it (perhaps actually write something in python that will use
the native portage code?), but it's what I'm using for now and seems to work fine.

Reproducible: Always
Steps to Reproduce:
Place script in cron.daily
Actual Results:  
Automatic email notification of available updates

Expected Results:  
Performs as expected (for me at least)

#!/bin/sh
#
# emergenotify.sh - automatic notification of package
# update availability
#
# Copyright (c) Stuart Bain <gun@gunandgiz.com>
# This program is distributed under the terms of GPL version 2.
#
# Instructions: modify the settings variables to suit your environment.
# Make sure you use a distinct username for each box you run this on.
# The hostemail is only used as a "From" address for the email, so you
# can use pretty much anything you want. Put your email address in the
# adminemail variable and drop this script in /etc/cron.daily/.
#

# <Settings>

hostname=YourServerName
hostemail=devnull@yourdomain.com
adminemail=yourname@yourdomain.com

# </Settings>

emerge sync > /dev/null ;

emerge -Uup world | grep ebuild > /tmp/emergenotify.txt;

test -s /tmp/emergenotify.txt && (
	echo "From: $hostname <$hostemail>" > /tmp/emergenotifymail.txt;
	echo "To: $adminemail" >> /tmp/emergenotifymail.txt;
	echo "Subject: Possible Package Updates" >> /tmp/emergenotifymail.txt;
	echo "The following packages may have updates available for 
installation on $hostname:" >> /tmp/emergenotifymail.txt;
	cat /tmp/emergenotify.txt >> /tmp/emergenotifymail.txt;
	sendmail $adminemail < /tmp/emergenotifymail.txt;
	rm -f /tmp/emergenotifymail.txt
);

rm /tmp/emergenotify.txt;
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2003-10-11 02:13:46 UTC
*** Bug 14642 has been marked as a duplicate of this bug. ***
Comment 2 Brian Harring (RETIRED) gentoo-dev 2005-02-27 23:13:50 UTC
This isn't really portage's deal to notify imo... an external tool in the interim makes more sense, since jamming a hook in for this will not be fun with current portage.
Comment 3 Peter Gantner (a.k.a. nephros) 2005-10-07 12:56:49 UTC
Just a side note: newer versions of "eix-update" (from app-portage/eix) do 
provide such a feature.
Comment 4 Alec Warner (RETIRED) archtester gentoo-dev Security 2006-01-05 15:08:57 UTC
(In reply to comment #3)
> Just a side note: newer versions of "eix-update" (from app-portage/eix) do 
> provide such a feature.

WORKSFORME

Use esync ( part of eix ).