Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Apr 1999 21:25:20 -0400
From:      Randall Hopper <aa8vb@ipass.net>
To:        Mark Ovens <marko@uk.radan.com>, "Michael G." <mikegoe@ibm.net>, David Kelly <dkelly@hiwaay.net>
Cc:        questions@freebsd.org
Subject:   Re: Deleting packages - a newbie question
Message-ID:  <19990418212520.A24218@ipass.net>
In-Reply-To: <19990418192714.B252@marder-1>; from Mark Ovens on Sun, Apr 18, 1999 at 07:27:14PM %2B0100
References:  <marko@uk.radan.com> <199904190005.TAA41276@nospam.hiwaay.net> <19990418134728.A11854@ipass.net> <99041817400401.00341@Nikki.ibm.net> <19990418134728.A11854@ipass.net> <19990418192714.B252@marder-1>

next in thread | previous in thread | raw e-mail | index | archive | help
    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) <TAB> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990418212520.A24218>