Commit Graph

62 Commits

Author SHA1 Message Date
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
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
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 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 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 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 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
sjg 7bd1e30c61 extract_plist() should inform caller when it aborts extract 2000-06-16 23:49:17 +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 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
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
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 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
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
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
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 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
hubertf 89f14c0f4e Prevent args of pkg_info -e from expansion (in case wildcard matching is requested) 1998-07-12 14:05:51 +00:00
hubertf 7a033bd0d4 Extend "pkg_info -e" to allow pkg-globbing, and allow using it. 1998-07-09 17:49:51 +00:00