Gentoo Archives: gentoo-dev

From: Juergen Ilse <juergen@×××××××××××.de>
To: gentoo-dev@g.o
Subject: [gentoo-dev] little function to delete packages ...
Date: Tue, 05 Feb 2002 08:10:04
Message-Id: 20020205150904.A2752@ilse.asys-h.de
1 Hello,
2
3 After "rsyncing" und "updating" my system, i wanted to delete old and
4 unnecessary packages. "ebuild" needs the complete filename of the file
5 in /var/db/pkg/*/*/*.ebuild to delete the package. I had to type the
6 full path every time, i wanted to delete an old version of a package ...
7 So i made a little shell-function (and placed it in roots .bashrc):
8
9 delpkg ()
10 {
11 _DBPKG_DIR=/var/db/pkg
12 for f in "$@";
13 do
14 case "$f" in
15 */*.ebuild)
16 ebuild ${_DBPKG_DIR}/$f unmerge;;
17 *.ebuild)
18 ebuild ${_DBPKG_DIR}/*/$f unmerge;;
19 */*)
20 ebuild ${_DBPKG_DIR}/"${f}"/*.ebuild unmerge;;
21 *)
22 ebuild ${_DBPKG_DIR}/*/"${f}"/*.ebuild unmerge;;
23 esac;
24 done
25 }
26
27 With this little function, i can simply type something like
28
29 delpkg net-ftp/pure-ftpd-1.0.8-r1/pure-ftpd-1.0.8-r1.ebuild
30 or
31 delpkg net-ftp/pure-ftpd-1.0.8-r1
32 or
33 delpkg pure-ftpd-1.0.8-r1.ebuild
34 or
35 delpkg pure-ftpd-1.0.8-r1
36
37 I prefer the 2. or 4. form of this command, because i go to /var/db/pkg
38 and do for example "ls app-admin" and then something like
39
40 delpkg <...>
41
42 with the via "cut&paste" copied names of the packages to delete (which
43 i can see in the output of ls) instead of <...>.
44
45 Maybe this little function is also useful for someone else ...
46
47 ciao,
48 Juergen Ilse (ilse@××××××.de)
49 --
50 Wenn ich auch nur aus jedem 1000. Bug in einem M$ Produkt|Juergen Ilse
51 einen Tag trauern wollte, also da muesste ich 300 Jahre |Internet POP Hannover
52 alt werden und wuerde mehrere Dutzend schwarze Anzuege |Vahrenwalder Str. 205
53 aufbrauchen. (Detlef Bosau in dcoulm) |30165 Hannover

Replies

Subject Author
Re: [gentoo-dev] little function to delete packages ... Geert Bevin <gbevin@×××××××.be>