Subject: tracking freebsd/openbsd pkg_add
To: None <tech-pkg@NetBSD.org>
From: William Allen Simpson <wsimpson@greendragon.com>
List: tech-pkg
Date: 09/30/2003 02:25:47
William Allen Simpson wrote:
> Well, that's why I asked whether somebody else was tracking freebsd or
> openbsd.  I'll start work on it for pkg_add tonight.
> 
OK.  Among the first things I've done is looked at the documentation.  
I've integrated the fixes for typos, grammer, and added explanations 
that have been added to openbsd & freebsd.  Since each has changed 
the macro set somewhat over the years, I kept the netbsd format (it 
appears to be an older version of freebsd.)

There are no changes in function (that I'm aware of) -- just text.  
It looks OK to me.  Do we have a style maven around here?

Index: pkg_add.1
===================================================================
RCS file: /cvsroot/src/usr.sbin/pkg_install/add/pkg_add.1,v
retrieving revision 1.45
diff -r1.45 pkg_add.1
20c20
< .Dd September 8, 2003
---
> .Dd September 29, 2003
56a57,58
> These packages are provided as a convenience for quickly installing software
> that would otherwise need to be built manually.
58,59c60,78
< can recursively install other packages that the current package
< depends on or requires from both local disk and via FTP.
---
> can recursively install other packages that the current package needs.
> .Pp
> One or more
> .Ar pkg-name
> arguments may be specified, each being either a file containing the
> package (these usually end with a
> .Dq .tbz
> suffix) or a
> URL pointing at a file available on an FTP or WWW site.
> Thus, you may extract files directly from their anonymous FTP or WWW
> locations (e.g.
> .Nm
> ftp://ftp.NetBSD.org/pub/NetBSD/packages/1.5/i386/shells/bash-2.04.tgz).
> .Bd -filled -offset indent
> .Em Note :
> System distribution files, e.g. base.tgz, comp.tgz, etc., are
> .Em not
> packages.
> .Ed
65,66c84,87
< your system may be susceptible to ``Trojan horses'' or other subtle
< attacks from miscreants who create dangerous package files.
---
> your system may be susceptible to
> .Dq trojan horses
> or other subtle attacks from miscreants who create dangerous packages.
> Be sure the specified package(s) are from trusted sources.
106,107c127,128
< Any dependencies required by the installed package will be searched
< in the same location that the original package was installed from.
---
> Any dependencies required by the installed package will be expected
> in the same location where the original package was found.
116c137,138
< If an installation script exists for a given package, do not execute it.
---
> When installation scripts exist for a given package,
> do not execute them.
166,167c188,190
< but when such does happen and you wish to have control over *all* directory
< transitions, then you may then wish to look into the use of
---
> but when such does happen and you wish to have control over
> .Em all
> directory transitions, then you may then wish to look into the use of
222c245,246
< when creating a ``staging area.''
---
> when creating a
> .Dq staging area .
225,229c249,252
< but it may be necessary to override it in the situation where
< space in your
< .Pa /var/tmp
< directory is limited.
< Be sure to leave some number of `X' characters for
---
> but it may be necessary to override it (see CAVEATS).
> Be sure to leave some number of
> .Dq X
> characters for
269,278d291
< .Pp
< One or more
< .Ar pkg-name
< arguments may be specified, each being either a file containing the
< package (these usually ending with the ``.tgz'' suffix) or a
< URL pointing at a file available on an ftp or web site.
< Thus you may extract files directly from their anonymous ftp or WWW
< locations (e.g.
< .Nm
< ftp://ftp.NetBSD.org/pub/NetBSD/packages/1.5/i386/shells/bash-2.04.tgz).
300,301c313,319
< extracts each package's "packing list"
< into a special staging directory in /var/tmp (or $PKG_TMPDIR if set)
---
> extracts each package's
> .Dq packing list
> into a special staging directory in
> .Pa /var/tmp
> (or
> .Ev PKG_TMPDIR ,
> see FILES and CAVEATS sections)
306c324
< A check is made to determine if the package or another version of it
---
> A check is made to determine whether the package or another version of it
309c327
< installation is terminated if the
---
> installation is terminated when the
311c329
< option is not given.
---
> option is not present.
315,318c333,336
< option is given, it's assumed the package should be replaced by the
< new version instead.  Before doing so, all packages that depend on the
< pkg being upgraded are checked if they also work with the new version.
< If that test is successful, replacing is prepared by moving an existing
---
> option is specified,
> all other packages that depend upon the package being upgraded are checked
> to determine that they also work with the updated version.
> If that test is successful, any existing
320c338
< file aside (if it exists), and running
---
> file is saved, and
322,324c340,341
< on the installed package.
< Installation then proceeds as if the package
< was not installed, and restores the
---
> is run to remove the existing package.
> Installation then proceeds, and the
326c343
< file afterwards.
---
> file is restored afterwards.
328c345
< A check is made to determine if the package conflicts (from
---
> If this package conflicts (from
332,333c349,350
< with an already recorded as installed package.
< If it is, installation is terminated.
---
> with a package already recorded as installed,
> installation is terminated.
351,352c368
< prefix directory rather than moving it through a staging area in
< .Pa /var/tmp .
---
> prefix directory without moving it through a staging area.
394,396c410,412
< is not present in the packing list,
< then it is used as a guide for moving (or copying, as necessary) files from
< the staging area into their final locations.
---
> is not used, then the packing list
> is used as a guide for moving (or copying, as necessary)
> files from the staging area into their final locations.
402a419
> .Pp
412a430
> .Pp
458,462c476
< The
< .Ar install
< and
< .Ar require
< scripts are called with the environment variable
---
> All the scripts are called with the environment variable
476c490
< This is the location of the
---
> The location of the
492c506,507
< The value of the
---
> If a given package name cannot be found,
> the directories named by
494,497c509,511
< is used if a given package can't be found, it's usually set to
< .Pa /usr/pkgsrc/packages/All .
< The environment variable
< should be a series of entries separated by semicolons.
---
> are searched.
> It should contain a series of entries separated by semicolons.
> (Note:  other distributions use colon.)
499,500c513,516
< The current directory may be indicated implicitly by an empty directory
< name, or explicitly by a single period.
---
> The current directory may be indicated
> implicitly by an empty directory name,
> or explicitly by a single period
> .Pq Ql \&. .
501a518,519
> It's usually set to
> .Pa /usr/pkgsrc/packages/All .
503,505c521,527
< Staging directory for installing packages, defaults to /var/tmp.
< Set to directory with lots of free disk if you run out of
< space when installing a binary package.
---
> Temporary area where packages will be extracted, instead of
> .Ev TMPDIR ,
> .Pa /var/tmp ,
> .Pa /tmp ,
> or
> .Pa /usr/tmp ,
> in that order.
510a533,554
> .Sh FILES
> .Bl -tag -width /var/db/pkg -compact
> .It Pa /var/db/pkg
> Default location of the installed package database.
> .It Pa /var/tmp
> Temporary directory for creating the staging area,
> when environmental variables
> .Ev PKG_TMPDIR
> or
> .Ev TMPDIR
> do not point to a suitable directory.
> .It Pa /tmp
> Next choice when
> .Pa /var/tmp
> does not exist or has insufficient space.
> .It Pa /usr/tmp
> Last choice when
> .Pa /var/tmp
> and
> .Pa /tmp
> are not suitable for creating the staging area.
> .El
561a606,624
> .Sh CAVEATS
> Package extraction does need a temporary area that
> .Bl -bullet -compact
> .It
> is big enough to hold the complete extracted package,
> .It
> can hold executable scripts.
> .El
> .Pp
> .Nm
> looks through ${PKG_TMPDIR}, ${TMPDIR}, /var/tmp, /tmp, /usr/tmp
> for such an area, in sequence.
> .Pp
> If ${TMPDIR} and /var/tmp are mounted noexec, you must set
> .Ev PKG_TMPDIR
> to a suitable area, as
> .Nm
> has no way to check for noexec status,
> except by failure to run installation scripts.
569,570c632,633
< and the link names are extracted with a single
< .Cm tar
---
> the link names are extracted with a single
> .Xr tar 1
572c635
< invocations due to exec argument-space limitations--this depends on the
---
> invocations due to exec argument-space limitations; this depends on the

-- 
William Allen Simpson
    Key fingerprint =  17 40 5E 67 15 6F 31 26  DD 0D B9 9B 6A 15 2C 32