From owner-freebsd-questions Sun Apr 18 18:27:35 1999 Delivered-To: freebsd-questions@freebsd.org Received: from pluto.ipass.net (pluto.ipass.net [198.79.53.5]) by hub.freebsd.org (Postfix) with ESMTP id DF30E14CBA for ; Sun, 18 Apr 1999 18:27:31 -0700 (PDT) (envelope-from rhh@ipass.net) Received: from stealth.ipass.net. (ts6-66-ppp.ipass.net [198.78.59.66]) by pluto.ipass.net (8.9.1a/8.9.1) with ESMTP id VAA14406; Sun, 18 Apr 1999 21:25:01 -0400 (EDT) Received: (from rhh@localhost) by stealth.ipass.net. (8.9.1/8.8.8) id VAA26312; Sun, 18 Apr 1999 21:25:20 -0400 (EDT) (envelope-from rhh) Date: Sun, 18 Apr 1999 21:25:20 -0400 From: Randall Hopper To: Mark Ovens , "Michael G." , David Kelly Cc: questions@freebsd.org Subject: Re: Deleting packages - a newbie question Message-ID: <19990418212520.A24218@ipass.net> References: <199904190005.TAA41276@nospam.hiwaay.net> <19990418134728.A11854@ipass.net> <99041817400401.00341@Nikki.ibm.net> <19990418134728.A11854@ipass.net> <19990418192714.B252@marder-1> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i In-Reply-To: <19990418192714.B252@marder-1>; from Mark Ovens on Sun, Apr 18, 1999 at 07:27:14PM +0100 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Thanks for the suggestions. I realize I could write my own custom wrapper script or alias to do this, as I mentioned, or do it by hand each time. But I thought I'd troll the waters and see if there was interest in this being the default behavior. It would make the package commands just a little more accessible to new users. 95% of the time when I delete a package, there's only one version and I know the name, but I don't have any idea what the version is. I just want to say "delete gv" and that's it. Completely unambiguous. But to Marks' point, yes when you have multiple versions of a tool installed, pkg_delete should report an error and list the packages matching your request ("not" delete them all). Even here, this behavior is a plus because the full package names are right there on your terminal. You don't have to go rooting around in /var/db/pkg or pkg_info -Ia listings to find out what you need to delete the package version you're interested in. Here's a shell snippet that does what I want: ( cd /var/db/pkg ; /bin/ls -1d mpeg_encode* ) | tr '\012' ' ' | /bin/sh -c 'read pkg1 junk ; if [ -z "junk"]; then echo ERROR: Multiple Matches ; echo $pkg1 $junk; else pkg_delete $pkg1; fi' I have no idea how to pack this into a tcsh alias. Besides it's at critical mass to make a wrapper script out of it anyway -- or just add to pkg_delete's internal behavior (which is what I'm asking for :-). Thanks, Randall |Randall Hopper: |> To delete a package, you can't just do: |> |> > pkg_delete xcoloredit |> |> you have to know the specific version even if its the only one installed. ... |> Is there some option permutation of pkg_delete to get the latter form to |> work? |> |> If not, I think this would be a handy feature. |> |> Yeah I know, I could just cook a pkg_delete wrapper script to do this, but Michael G.: |This is not an answer to your question..but I just wanted to |make sure you knew that you can look at /var/db/pkg to see all |the packages you have installed. The directory names you see |are exactly what you would type (or copy and paste) for use with |pkg_delete. David Kelly: |Change your shell to enable filename expansion and you can quickly read |the version number something like this (using tcsh) is ^I, tab: ... | % pkg_delete /var/db/pkg/fetchmail-5.0.0/ | |then the DELETE (or backspace) key and ^B can trim off the excess. Mark Ovens: |Why not extend what you already do? | | pkg_delete `pkg_info -Ia | grep coloredit | awk '{print $1}'` To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message