public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] little function to delete packages ...
@ 2002-02-05 14:09 Juergen Ilse
  2002-02-05 14:24 ` Geert Bevin
  0 siblings, 1 reply; 2+ messages in thread
From: Juergen Ilse @ 2002-02-05 14:09 UTC (permalink / raw
  To: gentoo-dev

Hello,

After "rsyncing" und "updating" my system, i wanted to delete old and
unnecessary packages. "ebuild" needs the complete filename of the file
in /var/db/pkg/*/*/*.ebuild to delete the package. I had to type the
full path every time, i wanted to delete an old version of a package ...
So i made a little shell-function (and placed it in roots .bashrc):

delpkg ()
{
    _DBPKG_DIR=/var/db/pkg
    for f in "$@";
    do
        case "$f" in
            */*.ebuild)
                ebuild ${_DBPKG_DIR}/$f unmerge;;
            *.ebuild)
                ebuild ${_DBPKG_DIR}/*/$f unmerge;;
            */*)
                ebuild ${_DBPKG_DIR}/"${f}"/*.ebuild unmerge;;
            *)
                ebuild ${_DBPKG_DIR}/*/"${f}"/*.ebuild unmerge;;
        esac;
    done
}

With this little function, i can simply type something like

	delpkg net-ftp/pure-ftpd-1.0.8-r1/pure-ftpd-1.0.8-r1.ebuild
or
	delpkg net-ftp/pure-ftpd-1.0.8-r1
or
	delpkg pure-ftpd-1.0.8-r1.ebuild
or
	delpkg pure-ftpd-1.0.8-r1

I prefer the 2. or 4. form of this command, because i go to /var/db/pkg
and do for example "ls app-admin" and then something like

	delpkg <...>

with the via "cut&paste" copied names of the packages to delete  (which
i can see in the output of ls) instead of <...>.

Maybe this little function is also useful for someone else ...

ciao,
	Juergen Ilse					(ilse@asys-h.de)
-- 
Wenn ich auch nur aus jedem 1000. Bug in einem M$ Produkt|Juergen Ilse
einen Tag trauern wollte, also da muesste ich 300 Jahre  |Internet POP Hannover
alt werden und wuerde mehrere Dutzend schwarze Anzuege   |Vahrenwalder Str. 205
aufbrauchen. (Detlef Bosau in dcoulm)                    |30165 Hannover


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [gentoo-dev] little function to delete packages ...
  2002-02-05 14:09 [gentoo-dev] little function to delete packages Juergen Ilse
@ 2002-02-05 14:24 ` Geert Bevin
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Bevin @ 2002-02-05 14:24 UTC (permalink / raw
  To: gentoo-dev

Hi,

you could also have used 'emerge --unmerge' which support dependency
matching allowing you to for example unmerge every application lower
than a certain version. It also defaults to not erase the latest version
of an application, but letting you have a working version on your system
at all times. Read 'emerge --help' for exact details.

Best regards,

Geert Bevin

On Tue, 2002-02-05 at 15:09, Juergen Ilse wrote:
> Hello,
> 
> After "rsyncing" und "updating" my system, i wanted to delete old and
> unnecessary packages. "ebuild" needs the complete filename of the file
> in /var/db/pkg/*/*/*.ebuild to delete the package. I had to type the
> full path every time, i wanted to delete an old version of a package ...
> So i made a little shell-function (and placed it in roots .bashrc):
-- 
Geert Bevin
the Leaf sprl/bvba
"Use what you need"           Pierre Theunisstraat 1/47
http://www.theleaf.be         1030 Brussels
gbevin@theleaf.be             Tel & Fax +32 2 241 19 98




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-02-05 14:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-05 14:09 [gentoo-dev] little function to delete packages Juergen Ilse
2002-02-05 14:24 ` Geert Bevin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox