Commit Graph

101 Commits

Author SHA1 Message Date
hubertf e968750664 Only warn about running as non-root when -v is given
(or when running in non-unprivilegedmode, but how to detect?)
2005-12-03 01:08:38 +00:00
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
grant 16133f304b mdoc fixes: use Sq and Dq instead of ' " and '' 2005-02-26 14:09:57 +00:00
wiz cc7ac0e40f Use Aq instead of \*[Lt]\*[Gt]. 2005-02-04 15:01:41 +00:00
wiz 9e0eb6c274 Minor macro usage improvements. 2005-02-04 14:58:59 +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
wiz 513f71684b Use more markup. 2004-12-15 17:17:51 +00:00
wiz 2add0ff922 Sync usage with man page; sort options. 2004-11-03 14:01:04 +00:00
wiz 624de60311 Bump date for -N; sort options; add N to SYNOPSIS. 2004-11-03 13:58:23 +00:00
erh 4f022501ab Merge version 20041101 from pkgsrc. 2004-11-02 00:38:23 +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
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
reed ab83e1a00d Improve explanations of the -R and -r options. This is partially
based on ideas from Greg A. Woods posted to netbsd-bugs list on
23/Jan/2004.
2004-01-29 01:56:17 +00:00
grant 83867bd596 no need to include errno.h. 2004-01-14 01:50:06 +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
wiz 255fb463e6 Bump date for previous. 2003-09-08 08:57:56 +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
wiz 88c9d9d14b Fix typo. 2003-07-04 12:17:32 +00:00
hubertf 33ec91dbc6 deleting as non-root works fine, so don't insist on running as root 2003-06-25 23:12:42 +00:00
agc 7b2c1a6c22 Firstly, let's give credit where credit is due - the idea came from uwe.
Add the ability to pkg_info(1) and pkg_delete(1) to take a directory
name for the name of the package, so that shell-completion can help
when finding out information or deleting packages.
2003-06-19 08:54:29 +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 582cc64a31 Set the program name via setprogname(3). 2003-06-05 13:15:43 +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 51ace543e3 Order the getopt(3) options alphabetically. 2003-01-10 10:55:25 +00:00
agc 82e88920e0 Add a pkgdb_remove_pkg() function and use it in pkg_delete(1).
Bump lib/version.h due to added functionality.
2003-01-10 10:17:21 +00:00
agc 9d61d2fff1 Add an enumerated type which is used in pkgdb_open() to specify
read-only or read-write mode.

Modify the return value of pkgdb_open() to have a more logical boolean
value.
2003-01-05 21:49:51 +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
wiz 5e977f5ead Ispell. Begin new sentences on a new line. 2002-09-26 01:41:51 +00:00
uebayasi 6a49247a32 Sprinkle .Xrs to packages(7). 2002-09-24 03:18:00 +00:00
grant eda9e509bb sweep of errx/warnx, remove unnecessary trailing \n 2002-07-20 08:40:16 +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
hubertf 99e2919b43 Improved error reporting: when a pkg pattern is given, and
/var/db/pkg does not exist (e.g. on a new system), say do!
2002-03-12 22:36:26 +00:00
drochner d3d59b3e4f print the package name on deletion errors 2002-02-15 12:42:34 +00:00
ross 2a76afae02 Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:36:18 +00:00
wiz df220a8153 Paragraph markup improvements, use Xr in one place. 2002-02-02 01:32:25 +00:00
agc c7f73c3331 "it's" is short for "it is".
The possessive pronoun is "its".
2001-10-04 19:44:48 +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