Commit Graph

57 Commits

Author SHA1 Message Date
wiz f0f9d6a437 Add compat #ifdefs from pkgsrc, to make syncing easier between the
two versions.
2005-11-05 13:11:02 +00:00
rillig 360e66cfd6 Output the error string when renaming a dependency file fails. This has
happened to me when I had a misnamed directory in the pkgdb directory.
2005-05-10 00:06:57 +00:00
wiz 968dbe95c1 Instead of exec(2)ing rmdir(1), just use rmdir(2).
Reviewed by dillo.
2005-05-07 15:09:41 +00:00
jlam a0ff816c39 Teach pkg_add(1) and pkg_delete(1) to pass PKG_METADATA_DIR and
PKG_REFCOUNT_DBDIR in the environment when running the +* scripts.
PKG_METADATA_DIR is the location of the +* files after the package is
registered.  PKG_REFCOUNT_DBDIR is the location of the reference counts
database directory.  If PKG_REFCOUNT_DBDIR is left unset, then it
defaults the the location of the package database directory with
".refcount" appended to the path, e.g. /var/db/pkg.refcount.

pkgviews users should explicitly set PKG_REFCOUNT_DBDIR in the shell
environment to ensure that all packages will use the same refcount
database.

These changes allow the +INSTALL and +DEINSTALL script to keep state
in +* files within ${PKG_METADATA_DIR}, and to store reference counts
in ${PKG_REFCOUNT_DBDIR} to handle usage of resources outside of
${LOCALBASE}.

Bump the pkg_install version to 20050204.
2005-02-04 09:03:02 +00:00
agc 6e58e2a640 Introduce a new abstraction in the C code, called MaxPathSize. All
previous occurrences of MAXPATHLEN and FILENAME_MAX have been changed
to use MaxPathSize instead.

If MAXPATHLEN is not defined, then assume a default value of 1024
(this is primarily for use on the Hurd).

The reason for this is that some older platforms define FILENAME_MAX
to be 14, although MAXPATHLEN is 1024. On BSD-derived systems,
FILENAME_MAX And MAXPATHLEN are both 1024.

Bump pkg_install version to 20041226.

These modifications have been tested so far on a NetBSD-current bulk
build.
2004-12-29 11:34:59 +00:00
erh 4f022501ab Merge version 20041101 from pkgsrc. 2004-11-02 00:38:23 +00:00
reed 027c7dd739 Make sure that the Fake mode would give a Verbose message about
the package to be deleted.  (Previously, the Fake mode only mentioned
deinstalling other dependent packages but didn't say anything
Verbose about the package itself.)
2004-01-29 17:41:49 +00:00
fvdl 82ac6194ae Don't compare an int to NULL. 2003-10-21 02:48:07 +00:00
wiz 161f3f684b Remove last vsystem caller and vsystem() itself. 2003-09-23 14:23:53 +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
jlam 505c7e361d Update pkg_install to 20030914. Changes from version 20030913 are
ensuring that recursive pkg_delete'ing works by using the correct
pkg_dbdir to find packages.  This fixes recursive deleting if the
-K flag is passed to pkg_delete(1), and the named dbdir differs from
the default dbdir (/var/db/pkg).
2003-09-14 04:58:30 +00:00
jlam f5e8befe51 Replace call to vsystem() with call to fexec() for speed. 2003-09-09 06:43:10 +00:00
jlam bfb9e5680c Allow the package entries in the pkgdbdir to be either directories or
symlinks to directories.  This gives the user more rope, but lets those
who know what they're doing to do what they want.
2003-09-08 22:11:12 +00:00
jlam 751f88a06a When executing "pkg_delete foo", only delete it if "foo" resolves to a
unique package.  This makes deleting packages less surprising in a pkgviews
world where you can have multiple versions of packages installed at the
same time in the package depot.

Also make "pkg_delete -f" work depoted packages if they have been added to
views by also running "pkg_delete -f" for the package instances in the
views.
2003-09-08 07:08:11 +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 ce691fb888 Replace calls to vsystem() by calls to fexec(). 2003-09-01 17:43:23 +00:00
agc 706a03ef9c Make the "-f" switch to pkg_delete(1) into a counter. Require two "-f"
switches to delete a package that has been preserved. Document this
change.
2003-06-12 13:50:38 +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
jschauma d571e4f803 Do not abort incomplete deletion if the cwd was removed. Instead, warn,
stay in no-longer existing dir and continue with removal of db-files;
otherwise, the packages contents would be removed, but the package not
uninstalled.  Pointed out by Grant in PR pkg/18384.  OK'd by hubertf.
2002-11-23 22:31:18 +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
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
drochner d3d59b3e4f print the package name on deletion errors 2002-02-15 12:42:34 +00:00
wiz e46d80027f Close some memory leaks.
Reported (incl. patch) by YAMAMOTO Takashi in pkg/12830.
2001-07-16 13:50:41 +00:00
hubertf 4b8c25f151 Prevent some minor descriptor leaks. 2001-03-04 18:16:42 +00:00
hubertf b471b566f8 In require_delete(), actually use the expanded wildcard passed in via
@pkgdep.

Fixes PR 10056 by Dan McMahill <mcmahill@mtl.mit.edu>
2000-05-07 00:33:28 +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 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
hubertf d29beeb5df Remove the LogDir (/var/db/pkg/foo-x.y) _after_ we've run the DEINSTALL
script a second time (else there's nothing left to run ;).

Noticed by Jim Wise.
1999-09-09 01:36:30 +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
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
hubertf 3fb135484d Call deinstall-script after files are removed:
deinstall <pkg-name> POST-DEINSTALL

(PKGTOOLS_REQD not bumped, as nothing in pkgsrc uses this so far)
1999-08-21 02:21:13 +00:00
hubertf c94d3e89cb Allow specifying a package name without a version.
If no (installed) package is found with the given name, "-[0-9]*" is
appended, and the search retried. Withs with any options to pkg_delete
and (esp.) pkg_info:

	pkg_info kde
	pkg_info -e emacs
	pkg_info -qL xlock
	pkg_delete -v emacs
1999-08-19 19:37:20 +00:00
abs 7960b91475 Ignore files in /var/db/pkg (hint 'pkg_info pkgdb.byfile.db') 1999-03-22 06:04:16 +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
abs 0dee719066 Fix '-f'. 1999-03-22 03:24:04 +00:00
hubertf 2b8601f04f be more cautious about preserving cwd 1999-03-20 00:29:19 +00:00
agc 4a5e3913cb Include <fcntl.h>, so that the definitions for O_* are defined. 1999-03-09 10:01:12 +00:00
hubertf e23d146ee6 TAILQ_FIRST and TAILQ_NEXT are not available on NetBSD 1.3 and 1.3.1,
define them for now.
Also fix a (unjustified) "variable may be used uninitialized" warning.
1999-03-09 02:20:49 +00:00
hubertf 4db56769f5 Add -R flag (similar to -r but the other way 'round) 1999-03-08 00:20:21 +00:00
hubertf 5909aead8e Back out last fix to remove knowledge about LogDir from require_delete(),
because it wasn't in LogDir when it was enterred. :-/

XXX A better fix to this would be to put this save-and-restore-CWD back
in and also add it to recurse_require_find() and require_find(), but
this is too much action for nothing now.
1999-03-03 20:12:06 +00:00
hubertf c9234a4571 - Put no assumptions into require_delete() on where the old CWD was
- Fix check for circular dependency
 - Most importantly: DO NOT remove the package if something depends
   on it, and -r isn't given!!!!! Without this change, pkg_delete was
   happily nuking away any package even if it had some dependencies.
1999-03-02 02:31:23 +00:00
agc fc1bcfe208 Quieten braindead gcc 2.8.1 unused warning. 1999-03-01 12:11:42 +00:00
chopps 862b113538 remove strequal, strcmp provides the functionality we need 1999-02-26 17:04:13 +00:00
chopps ad9eaac8ec add -r flag to delete all packages that require the user specified one 1999-02-26 10:49:30 +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