Gentoo Archives: gentoo-ppc-user

From: Calum Selkirk <cselkirk@g.o>
To: gentoo-user@g.o, gentooppc-user@g.o
Subject: [gentooppc-user] Re: new package notification
Date: Sat, 27 Jul 2002 15:59:49
Message-Id: 20020727205721.GL18216@gentoo.org
1 * Gregg [gregg@××.am] [2002-07-26 11:44 -0500]:
2
3 [snip]
4 > I want to see a list of new packages that are available after an
5 > rsync. Not updates to packages that were already there, but new
6 > directories in the portage tree.
7 >
8 > I keep my gentoo box as close to "portage only" as possible. It makes
9 > management easier and makes everything fit together the way it should.
10 > The Gentoo way. In doing so, I deny myself some applications taht do
11 > not have ebuilds yet.
12
13 That seems rather strange, to me at least. Why wait for a specific
14 ebuild when you can install in /usr/local (and /usr/local *is* part of
15 the "gentoo way" ;)
16
17 Anyhow ..
18
19 > I would love to see a list after an emerge rsync of what NEW packages
20 > that were not in my portage before, have been added. This will let me
21 > see whats new that I might install.
22 >
23 > Ideas range from portage keeping a log of what directories it actually
24 > creates durring rsync and allowing you to output that to a text file.
25 > To a script you run before and after that builds a list of the
26 > directories in the tree and compares the 2 lists, showing you the new
27 > directories. Im sure there are other ways as well.
28 >
29 > Any ideas? Anyone already have this working?
30
31 off the top of my head, i would do something like (oneliner):
32
33 zsh% =ls -d /usr/portage/*([^distfiles][^profiles][^scripts][^packages])**/*
34 >| /tmp/ports-list ; emerge sync && =ls -d \
35 /usr/portage/*([^distfiles][^profiles][^scripts][^packages])**/* \
36 >| /tmp/ports-list-new | comm -1 -3 /tmp/ports-list /tmp/ports-list-new \
37 >| /tmp/new_in_portage ; less /tmp/new_in_portage
38
39 i guess this could be done with bash also (if we set extglob). Here's a
40 short script (limited testing).
41
42 #!/bin/bash
43 # watznu.sh
44 shopt -s extglob
45
46 function ask()
47 {
48 echo -n "$@" '[y/n] '; read answer
49 case "$answer" in
50 y*|Y*) return 0
51 ;;
52 *) return 1
53 ;;
54 esac
55 }
56
57 lsportage="ls -d /usr/portage/*([^distfiles][^profiles][^scripts][^packages])**/*"
58
59 $lsportage >|/tmp/ports-list
60
61 emerge sync || exit
62
63 $lsportage >|/tmp/ports-list-new
64
65 comm -1 -3 /tmp/ports-list /tmp/ports-list-new >|/tmp/new_in_portage
66 rm -f /tmp/ports-list*
67
68 if [ -s /tmp/new_in_portage ]; then
69 echo "There are new ports in portage"
70 echo "Do you wish to see what these new ports are?"
71 ask && $PAGER /tmp/new_in_portage
72 else
73 echo "Nothing new in portage"
74 rm -f /tmp/new_in_portage
75 fi
76
77 # EOF
78
79 HTH
80
81 cal
82
83 ps. comments welcome