Commit Graph

171 Commits

Author SHA1 Message Date
abs 374ff93c9c Introduce path_prepend_from_pkgname() and path_remove_first() and
use in pkg_add to ensure the location of the package being added is
checked first for any additional packages.
2002-08-27 17:27:27 +00:00
hubertf dfa4cb8d4d Fix a few comments, and add some others to outline what's missing
in the pkg upgrade case (two TODOs :)
2002-08-16 00:47:39 +00:00
wiz f4813ef403 Drop trailing whitespace. 2002-08-15 03:26:38 +00:00
hubertf 3ddcffd0a9 document -u 2002-08-15 02:34:53 +00:00
hubertf ed4b7caed9 Try increasing number of max. open files as high as possible.
Prevents annoying errors when installing biggies like KDE.
2002-08-04 21:47:24 +00:00
jschauma a82bd2c37e Synch with reality (PKG_TMDIR defaults to /var/tmp (first)).
Pointed out by franklin at elfie dot org in PR pkg/17760,
discussed on packages@, approved by hubertf.
2002-07-31 01:39:40 +00:00
grant 6742cb1812 sweep of errx/warnx, remove unnecessary trailing \n 2002-07-20 08:36:17 +00:00
yamt 5eb02a32ce - remove handling of PKG_ADD_BASE.
- don't search current directory if PKG_PATH is set.
- don't prefer local directories.
- constify and cleanup.
discussed on tech-pkg.
2002-07-19 19:04:33 +00:00
toshii 5e1f92b4ef If "-f" is given, don't set errc on dependency add failure.
This change makes "pkg_add -f" work as it used to be.
2002-07-13 16:38:00 +00:00
yamt a8463800e2 don't pass null pointers to printf for "%s". 2002-07-09 04:35:30 +00:00
yamt 80a776becb constify and make WARNS=2 clean. 2002-06-10 09:14:26 +00:00
yamt 56268cdf57 constify. 2002-06-09 14:14:49 +00:00
yamt 51111fe65d - make last arg of findmatchingname void*.
- move some duplicated functions into lib/.
2002-06-09 13:23:44 +00:00
yamt cc8d347c9a - free memory allocated by findbestmatchingname.
- use static buffer instead of "malloc and don't free"
  for dirname_of.
- fix indent.
2002-06-09 11:56:59 +00:00
agc 5e5f49ecfa Check the return code from the second invocation of installprereq(), to
make sure that a failed installation of a rpe-requisite package kills
the attempt to add the package. This reverts pkg_add(1) to traditional
behaviour.

Bump version number accordingly.
2002-04-02 15:08:33 +00:00
agc 2e8bd5562d When adding packages via pkg_add(1), and a pre-requisite package needs
to be added, first try to use the exact version of the pre-requisite
with which the base package was built (from the @blddep directive in
the +CONTENTS file), and then use the traditional dependency from the
@pkgdep directive.

Also rename a variable from "code" to "errc" to make it obvious what
the variable counts.

Bump version number to 20020306.
2002-03-06 17:45:20 +00:00
ross 2a76afae02 Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:36:18 +00:00
ross 8bd7cb6a69 Edit -mdoc usage.
* There is no -indent option to .Bd or .Bl, although you would
  never know that from its frequent use in this tree. There is a
  "-offset indent" combination that makes sense, and you can certainly
  say "-width indent".

* Also, you can't markup the -width option argument, tho you CAN
  use a callable macro. So "-width Ar filename" doesn't make sense,
  but either "-width Ar" or "-width filename" does, as might something
  like "-width xxfilename" for a little extra space.

* There are a lot of needlessly complex hanging tag macros in man4 used
  to create simple item lists. Those should be simplified one of these
  days before someone copies and edits yet another man4 page.
2002-02-07 03:15:06 +00:00
wiz 923aa5f99b Drop an empty line. 2002-02-02 01:30:39 +00:00
hubertf 384aae98cc use full pathname of tar consistentlc
Patch provided in PR 14072 by Stoned Elipot <seb@script.jussieu.fr>
2001-09-26 13:48:27 +00:00
agc ead534127e Print out the name of the detached signature file which is being used to
verify the binary package. Idea from Hubert Feyrer.
2001-09-25 11:42:56 +00:00
agc 03663b89ae Add a "-s verification-type" argument to pkg_add, which adds a callout
to a verification program for a binary package. The following callouts
are defined: "none", "gpg" and "pgp5".

This feature allows you to verify a binary package against a detached
signature file, and to proceed with the installation or not, depending
upon the level of trust you place in the signatory of the binary
package.

Digital signatures will be checked in a recursive manner (i.e. if
pkg_add is called with a verification type which is not "none", the
verification type will be passed to subsequent invocations of pkg_add
for the dependent packages).

At the current time, digital signatures cannot be used with the URL
form of pkg_add(1) - the detached signature file must be in the same
directory as the binary package, either locally or mounted by NFS.

If no -s argument is given, pkg_add(1) retains its current behaviour -
the package will not be verified before installation takes place.
2001-09-25 10:28:16 +00:00
wiz 64662a0528 Fix `pkg_add -u' for packages without dependencies.
Patch by Hubert Feyrer.
Addresses pkg/13536.
2001-07-24 14:45:16 +00:00
wiz a9356936b4 seperate -> separate 2001-07-22 13:33:58 +00:00
wiz d422b80ea9 Uppercase Dt argument. 2001-06-05 11:58:55 +00:00
agc 95a52b2709 Add -I argument to pkg_create so that the real prefix can be specified
for the @src and @cwd PLIST directives.

Bump version number.
2001-05-21 09:17:28 +00:00
hubertf 965773e0ca Check for return value of getenv() before handing it to strdup().
Fixes a bug in last commit when PKG_ADD was not set.
2001-04-21 01:38:14 +00:00
dmcmahill b80446717f Allow PKG_PATH (or part of that) to contain a local directory, and
still let "pkg_add foo" work:

        setenv PKG_PATH /usr/upkgsrc/packages/All
        pkg_add -v kde2

Depending pkgs will be pulled in as usual.

If PKG_PATH contains a mixture of local paths and ftp://-URLs, the local
paths will be searched first.

Patch provided by Hubert.
2001-04-19 12:31:59 +00:00
itojun 939a343de8 have EXAMPLES section. 2001-04-10 01:39:44 +00:00
wiz 0037cd4f1b Whitespace fixes. 2001-04-09 12:46:47 +00:00
hubertf 6890588691 If a package is already installed, this is *not* a fatal error. Do not
report error code 1, as this will abort installing pkgs if a dependency is
already found installed under certain conditions.
2001-03-28 12:46:01 +00:00
hubertf 35be797120 Set return code != 0 if the given pkg (file) cannot be found.
E.g. try "pkg_add foo ; echo $?". This hits is in bulk builds.
2001-03-22 13:41:35 +00:00
wiz 47acaa6b2d Update path in example to a more recent package. Noted by zuntum. 2001-03-20 19:43:36 +00:00
hubertf 648fa44a28 Add -u switch to pkg_add to do a very rudimentare form of pkg upgrading:
When invoked with 'pkg_add -u ...', and the package to be installed is
found already being installed, the old (installed) package is removed
with pkg_delete, and the new one is installed.

A very crude handling of dependencies is done (by moving the +REQUIRED_BY
file aside before pkg_delete, and back into place after the new pkg is
installed).

This needs a lot more work to TRT, but it's a first start.
2001-03-18 03:20:28 +00:00
hubertf ee1019de50 Update description a bit - inspired by Jeremy C. Reed <reed@reedmedia.net>
from tech-pkg.
2001-03-13 18:25:30 +00:00
wiz 2ba98ef9a1 Add -V option to all pkgtools, which reports the version of the pkgtools.
Document it. While there, fix the ordering of the option descriptions in
some man pages. Set version to 20010305.
2001-03-05 16:53:12 +00:00
hubertf f4f6931307 Alphabetize options. 2001-01-07 01:39:20 +00:00
hubertf 5382dffae7 * Accept ".tbz" as an alternative pkg suffix to ".tbz" for pkg_add and
pkg_info
 * In pkg_create, compress with bzip2 if a .tbz suffix is given
 * Fix pkg_info to work via ftp, either via URL specified on command line
   or via one made up from PKG_PATH (if set)

XXX ALWAYS tacks on ".t[bg]z", NOT ".t[gb]z" !!!
2000-12-13 03:17:53 +00:00
is d8302e2d73 More format string cleanups by sommerfeld. 2000-10-11 20:23:46 +00:00
hubertf b31af88872 fix indentation 2000-10-11 11:01:41 +00:00
ad 5b09090e8e insure -> ensure 2000-10-05 12:35:33 +00:00
hubertf 197ee08b13 Don't replace the pkg version with -[0-9] on pkg alternates ("{foo-x,bar-y}")
as this will remove things like trailing '}' etc. and doesn't work in general.

As mentioned in the already-existing comment, doing TRT here would mean to
partly expand the pattern, then replace the versions on alternatives.
Unless our pkg pattern parser gets these hooks, cowardly step back.
2000-10-01 12:23:21 +00:00
hubertf 80c46f750e * Code cleanup
* Add a comment in one appropriate place
 * Indent properly
2000-09-01 04:36:20 +00:00
dmcmahill 43301f1fee Fix a buffer overrun bug. The TOOBIG macro had some hard coded constants
which needed to be set at compile time but weren't (to handle the case where
TAR_CMD was set to something other than "tar", eg "gtar".  In addition to
the constants being wrong, the wrong directory name was being examined for
its string length.

Add a few comments to hopefully avoid having this problem come back.
2000-07-24 20:09:15 +00:00
tron 1b5dabcf75 Update prototype for "extract_plist()". 2000-06-17 11:30:49 +00:00
sjg 7bd1e30c61 extract_plist() should inform caller when it aborts extract 2000-06-16 23:49:17 +00:00
sjg cc95d19ae1 avoid possible overflow of exit status 2000-06-16 23:48:23 +00:00
hubertf 7f040da3cd Don't remove any INSTALL scripts. Just in case someone needs them later
(e.g. to tar up the pkg again, and install it elsewhere).
2000-05-16 15:59:16 +00:00
hubertf d071991a9a Don't abort during quick depends pre-scan when -f is used 2000-04-01 23:31:39 +00:00
hubertf f996345ebf Improve the last change.
Handling all kinds of wildcards properly would be hard, though it should
handle some cases better now. Esp. ones with '-' in the pkg(!) name, and/or
ones with dewer relational versions. I.e. the teTeX-share>1.97 case should
work now.
2000-04-01 22:12:45 +00:00
augustss 93336646e4 Make this compile again. 2000-04-01 14:54:51 +00:00
hubertf 404096ac77 In the "quick depends pre-check" don't only try to replace anything
after a "-" with the "more liberal pattern", but also anything after
any pkg wildcard.

That way if someone has teTeX-share-1.0 installed and pkg_adds
teTeX-1.0.7 (which wants teTeX-share>1.0.2), it will be caught.

XXX This "quick depends pre-check" would be nice to be done in
    bsd.pkg.mk as well
2000-03-31 22:12:56 +00:00
hubertf 0c2cdb98d9 * in pkg_add, before the "install dependencies" loop, check ALL
dependencies if they _can_ be installed. I.e. if a package wants
   version X installed, but version Y is already installed, pkg_adding
   that required pkg will blow up later (probably some pkg_add recursions
   down, given what we keep in the depends list). Now, it stopps right
   away:

        noon# pkg_add /usr/pkgsrc/packages/i386ELF/All/xdaemon-1.0.tgz
        pkg_add: pkg `xteddy-1.*' required, but `xteddy-2.0.1' found installed.
        Please resolve this conflict!

   The idea of this is from Thomas Klausner, further inputs from Alistair
   Crooks.

 * allow pkg names without versions given to "pkg_admin check"
 * Use sizeof() instead of hardcoding the buffers' size in some places
2000-03-19 17:24:27 +00:00
hubertf 4a961a7fc3 some code cleanup 2000-01-25 12:09:19 +00:00
hubertf 9d0c5bb4ee FTP wildcard depends code, initial commit.
Modulo some code cleanup, this gives NetBSD full wildcard support not
only in pkgsrc, but esp. for binary packages installed from local disk
and via FTP. For more information, see:

	http://www.feyrer.de/NetBSD/wildcards.html
2000-01-19 23:28:28 +00:00
hubertf be120f8f41 Also move the +SIZE files into place, if a pkg comes with some. 2000-01-09 17:21:53 +00:00
hubertf 873c34bf5e Some changes from David Maxwell <david@fundy.ca>:
- make it clear that a URL or full path can be given on the command line
 - explain where depending pkgs are expected to live
2000-01-04 22:39:28 +00:00
hubertf d11f27480e Not without my handbag. (Forgot this in last commit) 1999-12-01 15:15:29 +00:00
hubertf 402f80b9da - Comment code
- Minor re-indenting
 - Fix printing of @ignore in pkg_info (did this ever work?)
 - Fix installing of local wildcard dependencies (unused in main system)
 - Fix deleting of packages that depend on wildcard dependencies
   (fexist() is not enough there :-)
1999-12-01 14:51:50 +00:00
kristerw 2220c68654 Typos (from OpenBSD) 1999-11-18 19:02:31 +00:00
abs 9c1ad975e8 Check return value from realpath() to avoid a NULL pointer being passed to
alloc_lpkg(). Avoids coredump if current directory is invalid.
1999-11-10 18:51:47 +00:00
proff e09818f9fd Apply Force (-f) recursively 1999-10-04 17:16:59 +00:00
hubertf 8ee940971e Bring closer to /usr/share/misc/style with the aid of indent(1). 1999-08-24 00:48:37 +00:00
hubertf c39c4fc075 Hide test for URLlength()>0 behind a macro (IS_URL()). 1999-08-23 15:17:03 +00:00
agc b62dac7b36 Provide full pathnames for chgrp(1), chown(1) and chmod(1), passing
them down from Makefile.inc on an OS-specific basis.  Fixes PR 8250
from Wiz <wiz@danbala.ifoer.tuwien.ac.at>.
1999-08-23 10:34:53 +00:00
agc 358f97854c Pass BINDIR down via Makefile.inc, rather than hardcoding /usr/sbin -
useful for systems where /usr/sbin is not the directory of choice.
1999-08-19 14:37:36 +00:00
agc d5c5c423a3 Consolidate URL handling into a table of valid leading strings for
URLs, and an access function (URLlength) - saves having various
hardcoded strings all over the place. Delete isURL, and use URLlength
in its place. Also use URLlength when parsing a filename for host
and filename part.
1999-08-19 14:12:34 +00:00
agc 72077b961b Clean up minor nits in C code. 1999-08-19 13:29:59 +00:00
tron 4ea05d6101 Add two missing "(void)" casts. 1999-08-19 07:18:38 +00:00
tron dffe3016d3 Modify conflict check to avoid matching packages with the same name prefix
(e.g. "teTeX" and "teTeX-share"). Patch is based on a suggestion by
Hubert Feyrer, fixes PR pkg/8219.
1999-08-19 07:17:35 +00:00
hubertf ef0989e5e0 Document PKG_TMPDIR 1999-07-02 19:05:45 +00:00
cgd bb8cb1198b Add support for fetching packages from HTTP URLs. Since 'ftp' is already
invoked for (FTP) URLs, this was just a matter of recognizing HTTP URLs
in the places where FTP URLs were recognized (and updating a comment and
the manual page).
1999-06-15 06:32:00 +00:00
tron 343ac4c964 Remove support for absolutes pathnames completely. This can't work with
binary packages like we support them now.
1999-05-30 16:08:23 +00:00
christos 3024caeb08 Don't prepend directories if the plist files are absolute. 1999-05-29 20:44:20 +00:00
tron 1fceefc0ce Fix wrong error handling in case "/var/db/pkg" needs to be created.
Patch suppled by Roland Dowdeswell in PR pkg/7566.
1999-05-12 20:43:49 +00:00
garbled d1407362ba More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages.  Many more to
come.
1999-03-22 18:43:46 +00:00
hubertf 04417da166 Replace static array of packages given to pkg_perform() with linear
list, using chopss' list functions (moved to lib/lpkg.c and
lib/lib.h).

Properly handle wildcards in arguments to "pkg_info", "pkg_delete" and
"pkg_admin check".

Some other minor cleanups.
1999-03-22 05:02:39 +00:00
tron 137c04ccf1 Fix string handling bugs introduced by last patch. 1999-03-12 17:32:20 +00:00
agc 530dddb95a Define TAR_CMD and TAR_FULLPATHNAME, and use them in preference to
hardcoded strings "tar" and "/usr/bin/tar". This allows the package
tools to use GNU tar with a different name (it's often installed as
gtar), and from a directory other than /usr/bin.
1999-03-09 11:10:39 +00:00
mycroft d77575d3c8 Clean up SYNOPSIS formatting. 1999-03-07 11:58:22 +00:00
agc 21fa5d1385 Cosmetic but annoying - no need to append a newline character in warnx()
string - it's done by warnx() itself.
1999-03-02 10:32:23 +00:00
hubertf 4ab7063639 If any other version of this package in stalled, stop. Document this. :) 1999-02-17 12:33:15 +00:00
hubertf e22dd1f460 Allow @exec to be the first (non-comment) thing in a PLIST file
IF there is no %d/%D/%f/%F in it.
1999-02-01 02:00:42 +00:00
hubertf f9e71e406c Add code for pkgdb. 1999-01-19 17:01:56 +00:00
hubertf ba73896f0c Fix some bugs discovered tonight when installing on a fresh 1.3.2
machine:
 - create /var/db/pkg if not there
 - fix wrong handling of findmatchingname() return code, resulting
   in missing /var/db/pkg dir being interpreted as match found
 - only move +BUILD_VERSION and +BUILD_INFO files if they're
   actually present (old pkgs don't have them!)
1998-11-07 23:16:50 +00:00
agc 3fdf3a6fae Modify pkg_create to recognise Build Information and Version files, when
creating packages, and modify pkg_add to copy the files when a binary
package is added. This preserves the fine-grained version information in
a binary package, and also the options with which the binary package was
built.
1998-10-26 17:39:20 +00:00
hubertf ee768386ba s/freebsd/netbsd/, pointed out by Heiko Rupp 1998-10-26 11:35:00 +00:00
agc 959d0a0cde + Remove obsolete and unused string functions.
+ Fix a bug introduced when the package name comparison routines were moved -
alternate matching now completes and works properly.
+ Add -R argument to pkg_create, which re-orders any directories in the
generated PLIST into reverse alphabetic order.
+ Add -l argument to pkg_create, which checks that any symbolic links in
the package are relative-to-$PREFIX pathnames, rather than full pathnames.
+ General cleanup elsewhere.
1998-10-12 12:03:24 +00:00
agc 9daf7cc9b2 More cleanup - various bits of KNF.
Use another table when parsing PLIST files - makes this much more extensible.
1998-10-09 18:27:31 +00:00
agc 16ae233008 Some minor KNF.
Lots more to be done.
1998-10-09 11:16:57 +00:00
agc 70c6765099 Eliminate all use of sprintf(3), and replace it with snprintf(3).
Bounds check the @exec and @unexec commands when they are constructed.
1998-10-08 12:57:58 +00:00
hubertf 4cc256a5d1 fix some egcs warnings 1998-10-04 01:48:15 +00:00
hubertf 0151583b9c Teach our tools about dependencies containing wildcards. 1998-10-03 16:24:07 +00:00
hubertf 4c0a9c52a7 In an ideal world, make_playpen() and leave_playpen() would maintain
a stack of directories, we'll do with a save/restore_dirs cludge for
now. => Fixes the bug I mentioned yesterday that shows when one pkg
installs another (depending) pkg via FTP.

Fixed another bug with extract-in-place when the destination dir is
already there.
1998-10-01 21:16:26 +00:00
tron 63ef9847d5 Fix broken package dependence handling mentioned by Brook Milligan on
"tech-pkg@netbsd.org".
1998-09-08 21:54:01 +00:00
hubertf e6c468e777 Make really sure to only nuke LogDir when it's been set. Fixes problem
described in PR 5308, code was contributed by Eivind Eklund <eivind@yes.no>.
1998-08-28 00:35:51 +00:00
hubertf 90c872591e Allow symlinks to directories instead of pure directories in several
places (/usr/pkg, /var/db/pkg, ...). Closes PR 6009 by Jim Bernard
<jimjbernard@ox.mines.edu>.
1998-08-27 23:37:35 +00:00
hubertf 2fb1caee16 Pass prefix for depending pkgs. 1998-08-25 01:16:03 +00:00
hubertf d54f140300 Remove some trailing (extra) "."s. 1998-08-25 00:54:08 +00:00
hubertf 1285035fe7 Don't exit cleanup() functions if not called from signal handler - this
will show error messages before aborting.
Patch supplied by Jim Bernard <jbernard@ox.mines.edu> in PR 6010, cleanup()
in delete/perform.c prepared to be used as signal handler by me.
1998-08-25 00:12:16 +00:00