Subject: Re: package management - 2 questions
To: Lou Glassy <glassy@caesar.cs.montana.edu>
From: None <mcmahill@mtl.mit.edu>
List: netbsd-users
Date: 10/18/1999 06:50:35
On Sun, 17 Oct 1999, Lou Glassy wrote:

> 
> hello all,
> 
> 2 short questions about package management with 
> the NetBSD pkg_* tools:
> 
> [1] What is the difference between using pkg_delete(1) to 
>     delete a package, and cd'ing into the package source
>     directory and doing a 'make deinstall'?
> 
>     Do these two commands do the same thing?  If not, 
>     how are they different?  I've read the man pages for 
>     the pkg_* utilities, and "Packages.txt", but it is 
>     not that clear to me that these are doing different 
>     things...?

if you built and installed the package from sources, you can do 'make
deinstall'.  However, is will call 'pkg_delete' to actually do the work.
The pkg_* tools are meant for manipulation of the binary packages.


> 
> [2] Is there a way to "retract" or "reverse" a package?
> 
>     Here is what I mean:  suppose I install a package
>     called 'foo-1.0'.  All right, after some time, I then 
>     install 'foo-1.1'.  When I do, all kinds of things break,
>     and now what I want to do is reverse back to what the 
>     system looked like before I installed foo-1.1.  (In DUX-speak,
>     this is "reversing a patch.")   

when you try to install foo-1.1, the package system will stop you and tell
you that you already have foo-1.0 installed.  So the upgrade path would
be:

pkg_delete foo-1.0
pkg_add foo-1.1.tgz    (assuming you have the binary package in your
current directory)

then if you don't like it,
pkg_delete foo-1.1
pkg_add foo-1.0.tgz  (also assuming you still have a copy of the foo-1.0
binary package).


> [3] (Remember, there are three kinds of computer scientists: those
>     who can count, and those who can't.)
> 
>     What (by the way) is the difference between
> 
> 	pkg_add foo-1.0		and 	cd /usr/pkgsrc/*/foo-1.0
> 					make ; make install
>     and
> 	pkg_delete foo-1.0	and 	cd /usr/pkgsrc/*/foo-1.0
> 					make deinstall


the second column is for building the package from sources and
installing/deinstalling.  The first column is if you have a pre-built
binary package, except the pkg_add would be more like
pkg_add foo-1.0.tgz   

or

pkg_add
ftp://ftp.netbsd.org/pub/NetBSD/packages/1.4.1/i386/All/foo-1.0.tgz

(assuming there is a binary package for foo-1.0 already built for
NetBSD-1.4.1/i386 on ftp.netbsd.org)

hope this helps

-Dan