From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on finch.gentoo.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DMARC_MISSING, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=4.0.0 Received: from talaxia.ilse.asys-h.de (talaxia.ilse.asys-h.de [62.48.88.14]) by chiba.3jane.net (Postfix) with ESMTP id BB939200B287 for ; Tue, 5 Feb 2002 08:10:04 -0600 (CST) Received: by talaxia.ilse.asys-h.de (Postfix on SuSE Linux 7.0 (i386), from userid 100) id C1A268CCE; Tue, 5 Feb 2002 15:09:04 +0100 (CET) Date: Tue, 5 Feb 2002 15:09:04 +0100 From: Juergen Ilse To: gentoo-dev@gentoo.org Message-ID: <20020205150904.A2752@ilse.asys-h.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Subject: [gentoo-dev] little function to delete packages ... Sender: gentoo-dev-admin@gentoo.org Errors-To: gentoo-dev-admin@gentoo.org X-BeenThere: gentoo-dev@gentoo.org X-Mailman-Version: 2.0.6 Precedence: bulk Reply-To: gentoo-dev@gentoo.org List-Help: List-Post: List-Subscribe: , List-Id: Gentoo Linux developer list List-Unsubscribe: , List-Archive: X-Archives-Salt: 34afc8ec-9186-4790-9f56-c9228ec3c9fa X-Archives-Hash: 12547cd8e675c05cb128a92b845c2e73 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