Gentoo Archives: gentoo-dev

From: Marko Mikulicic <marko@××××.org>
To: mkennedy@g.o
Cc: gentoo-dev@g.o
Subject: Re: [gentoo-dev] [gentoo-user] new package notification
Date: Wed, 11 Sep 2002 01:45:38
Message-Id: 3D7EE68A.9070109@seul.org
In Reply to: Re: [gentoo-dev] [gentoo-user] new package notification by Matthew Kennedy
1 Matthew Kennedy wrote:
2 > Gregg <gregg@××.am> writes:
3 >
4 >
5 >>I have mentioned this a couple times to usually no response. I feel that
6 >>it is an important feature , I was hoping to get some sort of response to
7 >>this as to how it should be done, or a response saying "we are already
8 >>working on that". Either way is fine by me :)
9
10 I wrote a script that do this some times ago. I have still to fix a
11 minor glitch before it's incorporated
12 in gentoolkit, but it's usable.
13
14 <snip filename='emerge-rsync'>
15 #!/bin/sh
16 BASE=/var/cache
17 USE_COLORS=yes
18
19 # end user configuration section
20 . /etc/make.globals
21 BEFORE=$BASE/ebuild-rsync.before
22 AFTER=$BASE/ebuild-rsync.after
23 NEW=$BASE/ebuild-rsync.new
24 REMOVED=$BASE/ebuild-rsync.removed
25
26 if [ "$USE_COLORS" == "yes" ]; then
27 RED="\033[;31m"
28 GREEN="\033[;32m"
29 NORMAL="\033[m"
30 fi
31
32 function portagetree () {
33 find $PORTDIR -type d -mindepth 2 -maxdepth 2
34 }
35
36 function inherit {
37 true
38 }
39
40 # do it
41 portagetree >$BEFORE
42 emerge $@ rsync
43 portagetree >$AFTER
44 diff $BEFORE $AFTER | grep ">" | sed "s/> //g" > $NEW
45 diff $BEFORE $AFTER | grep "<" | sed "s/< //g" > $REMOVED
46
47 # cleanup
48 rm $BEFORE $AFTER
49
50 # display new ebuilds
51 if ! diff -q $NEW /dev/null >/dev/null; then
52 echo
53 echo New ebuilds:
54 for i in $(cat $NEW); do
55 DESCRIPTION="$i/*.ebuild ${RED}does not exist$NORMAL"
56 EBUILD=$(ls $i/*.ebuild --sort=time 2>/dev/null | head -n 1)
57 [ -z "$EBUILD" ] || . $EBUILD
58 echo -e $GREEN${i##$PORTDIR/}$NORMAL: $DESCRIPTION
59 done
60 fi
61
62 # display removed ebuilds
63 if ! diff -q $REMOVED /dev/null >/dev/null; then
64 echo
65 echo Removed ebuilds:
66 for i in $(cat $REMOVED); do
67 echo -e $RED${i##$PORTDIR/}$NORMAL
68 done
69 fi
70 </snip>