Commit Graph

102 Commits

Author SHA1 Message Date
agc ef020cc402 Re-work the code which checks the recorded build versions of a binary
package to make pkg_add work properly when no +BUILD_INFO file exists.

Modify the return value from read_buildinfo() to return 1 for success
and 0 for failure.

Use symbolic constants, rather than integers.

If we can't read the build information, always tell of this fact.

Bump version to 20040730

Addresses PR 26429; a different version of these mods were verified to
allow a +BUILD_INFO-less binary package to be added by Martin Husemann.
2004-07-30 11:35:46 +00:00
grant 0f204e9fc9 fix typo. 2004-05-08 16:50:37 +00:00
tv f3215814d5 20040428: In pkg_add, set the umask nice and early, and remove an absolute
setting of mode in a mkdir command.
2004-04-28 15:37:29 +00:00
tv 5b799f00cc Hi there. I'm a stack-allocated array. I'm filled with garbage until
someone puts something useful in me, like zero bytes.

(Read:  Fix uninitialized array member access in pkg_add.  Bump to 20040421.)
2004-04-21 20:10:10 +00:00
rh 56d86cdd8c Make pkg_add recognise binary packages built with ignored recommendations
(IGNORE_RECOMMENDED set in the presence of RECOMMENDED pre-requisites).
This change is fully backward-compatible: binary packages have set the
corresponding BUILD_INFO since RECOMMENDED was implemented.  Packages
built before that time will install as before.
Bump PKGTOOLS_VERSION to 20040411.
This closes PR pkg/24712 by Thomas Klausner.
2004-04-11 06:13:46 +00:00
abs 0be46fce4e Fix file descriptor leak in read_buildinfo() which caused one leaked
descriptor per package inspected. 'pkg_add *' in a large directory now
works.  Update PKGTOOLS_VERSION to "20040410"
2004-04-10 09:10:17 +00:00
tv 94b8c2cf60 Re-add umask() setting, and parameterize it so that pkgsrc/bootstrap based
pkgsrc platforms can override the value.
2004-04-09 18:27:48 +00:00
tv 45669ab694 Changes to make these work on Interix: remove nonroot warnings if on
Interix, and remove absolute setting of umask in pkg_add.
2004-03-29 21:41:39 +00:00
jlam 0c45ef07f3 Don't warn and abort if a package with the same ${PKGBASE} already exists
if we're installed a depoted package.
2004-01-14 23:32:36 +00:00
grant 99871d087e use ${MACHINE_ARCH} instead of what uname() puts into utsname.machine.
the former represents the CPU architecture, which is what is recorded
in binary packages.

also allow the OS name to be overridden, as pkgsrc doesn't always use
the value of utsname.sysname.

bump version to 20030113.
2004-01-13 08:30:34 +00:00
hubertf d7b7063649 In the "quick depends pre-scan", first print all bad matching depends,
then exit (instead printing one conflicting pkg/version on each run).
2004-01-04 01:47:35 +00:00
grant dd46f97f58 use the --use-compress-program argument to tar and do away with
the file descriptor handling mess in lib/file.c.

also use --fast-read where applicable.

result of pkg_info -B on 1.5ghz pentium4, linux:

			before		after
mozilla-1.4nb1.tgz	1.96sec		0.04sec
mozilla-1.4nb1.tbz	18.66sec	0.21sec

866mhz pentium3, NetBSD:

			before		after
mozilla-1.4nb1.tgz	2.22sec		0.07sec
mozilla-1.4nb1.tbz	16.29sec	0.34sec

-rw-r--r--    1 grant    users    13816195 Dec 20 13:59 mozilla-1.4nb1.tbz
-rw-r--r--    1 grant    users    15814227 Dec 20 13:58 mozilla-1.4nb1.tgz

XXX fetches over ftp/http still read the whole file.
2003-12-20 03:31:56 +00:00
grant 70ba7aa408 check the OS, architecture and version of a package against the host
and spit out a warning if any of them differ. bail if the OS or arch
differ. installation can be forced with -f.

sanity checked by simonb. fixes PR pkg/18966 from mrg.
2003-12-20 00:47:18 +00:00
wiz 7e60425a84 Get rid of lots of system(3) (partly via vsystem) calls.
Previous version reviewed by agc.
Closes PR 20518.
2003-09-23 09:36:04 +00:00
grant fd9dca3d28 don't assume mtree is in BINDIR, allow it to be overridden by
MTREE_CMD.
2003-09-23 06:19:45 +00:00
jlam 6a37e1039a When adding depoted packages into the depot, manipulate the correct
pkgdb.byfile.db by using the fact that depoted packages have their
dbdir == ${DEPOTBASE}.
2003-09-08 07:00:10 +00:00
jlam 1a174cde55 Merge src/usr.sbin/pkg_install on the pkgviews branch into the HEAD by
running:

        cd src/usr.sbin/pkg_install
        cvs update -Pd -A
        cvs update -Pd -j pkgviews-base -j pkgviews
2003-09-02 07:34:47 +00:00
tron a58c832dd6 Replace calls to vsystem() by calls to fexec() or fcexec(). 2003-08-25 10:35:28 +00:00
tron 2f1b656bac Replace a few calls to vsystem() with calls to fexec() to speed up
operations.
2003-08-24 21:11:37 +00:00
itojun 041bd7648a use bounded string op as much as possible 2003-07-14 06:00:44 +00:00
seb 2eb61ac136 pkg_add fix:
When doing quick pre-check if any conflicting dependencies are installed
and a dependency is not found installed do not try to search for a wildcarded
(-[0-9]* suffix) package if the dependency was already wildcarded.

This prevent something like 'p5-Net-DNS-0.33' reported as an already
installed version of 'p5-Net-[0-9]*' as a dependency.
Before this fix 'p5-Net-[0-[0-9]*' would have been incorrectly searched for.

Reviewed by hubertf@.

Bump PKGTOOLS_VERSION to 20030423.
2003-04-23 10:02:23 +00:00
hubertf 4af963d89d Rename "upgrade" variable to "Replace" (etc.) as that is what it's really
for. Assorted text updates.
2003-04-22 01:17:03 +00:00
grant ef79ced85d improve error when there's not enough space to unpack in PKG_TMPDIR. 2003-04-10 16:12:38 +00:00
seb f34edd6ece Pkg_add fix: if an install script is present move it into LogDir
(PKG_DBDIR/PKGNAME).  Address PR pkg/20856 and part of PRs pkg/20852,
pkg/20853 and pkg/20854 by FUKAUMI Naoki <naoki at fukaumi dot
org>.

Note: with this change pkg_tarup can now produce reusable binary
packages from installed packages when they depend on an install
script.
2003-03-24 22:13:54 +00:00
hubertf 6b5ef93cc3 Implement remaining TODO item in pkg upgrade (pkg_add -u):
* Upgrade step 1/4: Check if the new version is ok with all pkgs
 * (from +REQUIRED_BY) that require this pkg

Inspired by bsd.pkg.mk's upgrade(?) target.
2003-03-24 13:47:13 +00:00
agc 17a35e2e99 Introduce the notion of "preserving" an installed package.
A preserved package may not be deleted by pkg_delete(1) (unless the -f
option is given), and the preserved capability will be carried into
any binary package. pkg_add(1) will also keep the preserved capability
if it was present in the binary package.

The "preserve" capability can be given to a package by using the
PKG_PRESERVE definition in a package Makefile in pkgsrc.

Ride on the recently-bumped lib/version.h for new functionality.
2003-01-10 11:55:44 +00:00
agc 1b535c4ef0 Use EXIT_FAILURE, rather than hardcoding a value of '1' in err(3) and
errx(3).

Plug a memory leak by modifying the signature of
_pkgdb_getPKGDB_FILE() to take a buffer and its size, and fill in that
buffer and return it.
2003-01-05 21:27:20 +00:00
grant f437cb0639 s/anyways/anyway/ 2002-11-05 07:34:31 +00:00
christos 590fa669c8 - eliminate the hard-coding of pathnames in the default install.
- all command executions now use the path [execvp/execlp/system].
- normalize the macro names as <COMMAND>_CMD.
- in some OS's full pathnames for commands can still be provided, but this
  is not the default.

This was needed to fix -DTAR_FULLPATHNAME="/usr/bin/tar"
2002-10-17 03:31:33 +00:00
abs acfcf99e58 Do not prepend '.' to path when looking for dependencies for a package
specified without any path components. (Pointed out by Takashi Yamamoto)
Rename path_remove_first() to path_prepend_clear().
2002-08-29 21:46:33 +00:00
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
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 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
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