1 |
Alexander Futasz <acid.punk@×××.net> writes: |
2 |
|
3 |
> On 10 Sep 2002 11:30:38 -0500 |
4 |
> Matthew Kennedy <mkennedy@g.o> wrote: |
5 |
> |
6 |
> > #!/bin/bash |
7 |
> > |
8 |
> > history=/tmp/package.history |
9 |
> > |
10 |
> > available_packages() { |
11 |
> > ( qpkg -I -nc && qpkg -U -nc ) |uniq |sort |
12 |
> > } |
13 |
> > |
14 |
> > if [ -f ${history} ] |
15 |
> > then |
16 |
> > available_packages >${history}.new |
17 |
> > diff ${history} ${history}.new |
18 |
> > mv -f ${history}.new ${history} |
19 |
> > else |
20 |
> > echo "First time run. Building history..." |
21 |
> > available_packages >${history} |
22 |
> > fi |
23 |
> |
24 |
> - ( qpkg -I -nc && qpkg -U -nc ) |uniq |sort |
25 |
> + ( qpkg -I -nc && qpkg -U -nc ) |sort |uniq |
26 |
> |
27 |
> $ whatis uniq |
28 |
> uniq (1) - remove duplicate lines from a sorted file |
29 |
> |
30 |
|
31 |
Doh. And here's another improvement: |
32 |
|
33 |
available_packages() { |
34 |
qpkg -U -nc | sort | uniq |
35 |
} |
36 |
|
37 |
(Since you already know about the packages you have installed and thus |
38 |
wouldn't be interested in them) |
39 |
|
40 |
Matt |
41 |
|
42 |
-- |
43 |
Matthew Kennedy |
44 |
Gentoo Linux Developer |
45 |
Bugs go to http://bugs.gentoo.org! |
46 |
|
47 |
Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6C25B0A2 |
48 |
Finger Print: 0C61 0CBC C669 5F26 8DBF 006D FBAB 30EA 6C25 B0A2 |