Commit Graph

41 Commits

Author SHA1 Message Date
Oliver Eikemeier
b9ba84598d - pkg_add spawns itself as argv[0] when installing dependent packages, to
enable the use as a port on older systems

- use absolute paths in all calls to external programs, to account for strange
  PATH settings

- use INDEX or INDEX-5 depending on FreeBSD version, to enable the use on
  FreeBSD 4.x as a port.

- conditionalize all 4.x/5.x differences on __FreeBSD_version, so that the
  pkg_install tools can be kept in sync on 4.x and 5.x

- Bump PKG_INSTALL_VERSION

Reviewed by:	portmgr (bento run)
MFC after:	4 weeks
2004-06-29 19:06:42 +00:00
Oliver Eikemeier
43b4652a71 - pkg_info: flag -r: (show packages this packages depends on (documentation change))
- pkg_info: new flag -j (show the requirements script)

- pkg_info: fix verbose output when used on packages

- better handling of corrupt entries in /var/db/pkg

- differ between corrupt entires and packages not installed

- various small fixes

PR:		56989, 57016, 57029, 26468
2004-06-29 18:59:19 +00:00
Oliver Eikemeier
6372c5ec85 - match package version numbers with relational operators
- use glob patterns when matching packages by origin

- csh-style {...} choices in glob matching

- pkg_info: new flag -E (list matching package names only)

- pkg_version: new flag -T (test if a given name matches a pattern)

- new flag -X (interpret pattern as an extended regular expression)

PR:		56961
2004-06-29 18:54:47 +00:00
Dag-Erling Smørgrav
0f98df2956 Fix a long-standing bug where if the package being deleted had no
post-deinstall script, the variable intended to hold the name of that
script would be used uninitialized.  In some cases, fexists() would
succeed, causing pkg_delete to try to chmod +x it, then execute it,
resulting in bizarre error messages such as:

.//: Permission denied

This bug would normally only occur when multiple packages were
specified on the command line; otherwise post_script would be located
in a previously unused part of the stack, and implicitly (but quite
accidentally) initialized to all-zeros.

MFC after:	3 days
2003-02-25 15:01:54 +00:00
Maxim Sobolev
dd3a3dfc3b - Make use of DEPOROGINs (if there are any) when installing package;
- fix few bogosities here and there;
- move some common routines into the library.

MFC after:	2 weeks
2002-05-14 21:42:37 +00:00
Alfred Perlstein
f7bb25f702 replace __FUNCTION__ with standardized __func__.
Requested by: jhb
2002-05-11 04:17:55 +00:00
Alfred Perlstein
a2bcd1a09f fix build:
you may not use string concatination with __FUNCTION__, replace all occurances
of:
__FUNCTION__ ": error string"
with:
"%s: error string"
2002-05-11 03:48:49 +00:00
David E. O'Brien
0d8875ff46 Fix SCM ID's. 2002-04-01 09:39:07 +00:00
Maxim Sobolev
a09c8e438b Various fixes and improvements:
- fix harmless compiler's warnings (unused variables and missed prototype);
- before refusing to delete package because "there are packages installed
  that require this package" check that packages in question is actually
  installed;
- add new `-r' option to pkg_delete(8), which instructs it to delete not only
  packages specified at command line, but all packages that depend on
  specified packages as well.

MFC after:	2 weeks
2001-09-19 08:06:48 +00:00
Maxim Sobolev
3d02d34c75 Cosmetics: replace dozen instances of "(tmp = getenv(PKG_DBDIR) ? tmp : DEF_LOG_DIR)"
with macro.

MFC after:	1 month
2001-08-02 13:13:06 +00:00
Maxim Sobolev
2d800f2bd9 Usability tweak:
Use '' quotes instead of `' to delimit names of files and packages in
  warning and error messages, because it is easier to cut-n-paste name in
  question that way (single click) without confusing the shell. And yes,
  I know that it is less eye-candy...

MFC after:	1 month
2001-08-02 12:38:29 +00:00
Maxim Sobolev
7f7ace8fb2 Style policy: reformat multiline comments to conform to style(9). 2001-05-17 10:12:45 +00:00
Maxim Sobolev
a658650611 When creating a package sort dependencies in such a way that if dependency
A depends on dependency B then dependency A will be in all cases listed
before B, so ``pkg_add -r'' will fetch/install packages in the correct order.

Previously dependencies were sorted just by its names, which is why
``pkg_add -r'' never actually worked properly.

To be usefull, hovewer, this fix requires that all packages have been
rebuilt, so it will take some time until users would be able to feel
posititive improvements. For the same reasons it is desirable to propagate
these changes to the 4-stable package building cluster *before* 4.3 ports
freeze, so packages for 4.3-RELEASE would be properly prepared.

Prompted by:			kris
Insanely appreciated by:	obrien
Silently approved by:		jkh, -ports
2001-03-15 10:47:00 +00:00
Ollivier Robert
12fd045a2c When called with the "-n" command line argument, pkg_delete
is supposed to inform the user of all steps it would take.

The current code does not issue any messages regarding actions
that would be performed by delete_package (removing files and
executing @unexec commands), because when the Fake variable
is 1, delete_package (which itself respects Fake and prints
messages rather than taking action when it is 1) is not called
at all.

Fix this.

PR:		bin/24971
Submitted by:	Thomas Quinot <thomas@cuivre.fr.eu.org>
2001-03-04 17:38:38 +00:00
Maxim Sobolev
29114b9283 - Merge recently added into pkg_info(1) regex/glob matching functionality into
pkg_delete(1) as well;
- add a new `-a' option for pkg_delete(1) to delete all installed packages;
- add a new `-i' option for pkg_delete(1) to request simple rm(1)-like
  interactive confirmation before attempting to delete each package.

Silently approved by:	jkh, -ports
2001-02-27 09:00:18 +00:00
Maxim Sobolev
639a9162ad Fix a typo, that in some cases may lead to incorrect packages reordering. 2001-02-21 02:01:10 +00:00
Maxim Sobolev
2a0eee8b7f Improve pkg_delete(1) behaviour when deleting several packages at once.
Instead of trying to delete packages in the same order as they were specified
in the command line, reorder deletion in such a way that if package A depends
on package B then package A will be deleted before B no matter in which order
they were specified in the command line.

Reviewed by:	jkh, will
Approved by:	jkh
2001-02-19 13:26:13 +00:00
Jordan K. Hubbard
aed4d2d137 Cause fatal error messages to be a little more helpful to the programmer
concerning where they're taking place.

Switch from [r]index() to str[r]chr() functions, which are more ISO
compliant.

Prompted by:	Edward Welbourne <eddy@vortigen.demon.co.uk>
2000-10-22 09:53:27 +00:00
Tim Vanderhoek
87dc218ee3 Use rm -f if the -f (force) option was given. 2000-06-02 04:32:37 +00:00
Sheldon Hearn
3c47fb7922 Fix bogon in previous commit: pass a string argument to printf(3) to
satisfy the %s conversion format specifier.

Reported by:		Mark Huizer <freebsd@xaa.iae.nl>
2000-01-11 13:40:20 +00:00
Sheldon Hearn
b8d1e942b5 Use a more helpful fatal error message than "Toto! This doesn't look
like Kansas anymore!" when unable to return to the original working
directory.

PR:		bin/16015
2000-01-11 12:37:16 +00:00
Peter Wemm
97d92980a9 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
Bill Fumerola
0845a96cd0 -Wall fixes. Ambigious if/elses, uninitialized values, missing headers,
missing prototypes, and empty format strings.
1999-08-11 20:55:42 +00:00
Jordan K. Hubbard
0440e20b71 Make it possible to have separate install scripts as well as have
an on-delete script.

Submitted by:	Rajesh Vaidheeswarran <rv@fore.com>
1998-12-16 13:59:31 +00:00
Jordan K. Hubbard
1b771b9577 Fix bug where trailing slash could confuse the registry removal.
Noticed by:	des
1998-11-11 06:09:04 +00:00
Jordan K. Hubbard
375ca45770 correct usage of cleanup() everywhere - this became bogus when the warnx/errx
stuff was added and nobody seems to have noticed. :)
Noticed by:	Josh MacDonald <jmacd@paris.CS.Berkeley.EDU>
1998-09-11 07:26:58 +00:00
Jordan K. Hubbard
570f313ee4 Don't return from cleanup() - if it's removed the playpen then very
bad things will happen if we return to unsuspecting code.
Noted to my great dismay by:	Tim Vanderhoek <hoek@hwcn.org>
1997-10-13 15:03:55 +00:00
Philippe Charnier
6fed414929 Use err(3). Cosmetics in usage string and man page. 1997-10-08 07:48:21 +00:00
Jordan K. Hubbard
8375be7ed6 Protect against missing initial @cwd. Closes PR#2893
Submitted-By: pius@iago.ienet.com
1997-03-06 10:21:57 +00:00
Peter Wemm
476602a9d0 Revert $FreeBSD$ to $Id$ 1997-02-22 16:15:28 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Jordan K. Hubbard
50f56e483a Add MD5 checksums to packing list for all files during pkg_create and use
later at pkg_delete time to verify that you're deleting what you added.
This, of course, does NOT cover the case where a file you still need
hasn't changed!  That's a tougher problem to solve, and this provides
only the minimal amount of safety belt.  MD5 checksums are stored in comment
fields, so packages produced with these tools are backwards compatible with
the older ones.
1996-07-30 10:48:20 +00:00
Jordan K. Hubbard
a9ef0b2904 Make pkg_install understand and use libftpio instead of its own
copies of the ftp support routines.  Also some cosmetic and minor
bug fixes I've been meaning to incorporate for awhile.
1996-06-20 18:33:55 +00:00
Jordan K. Hubbard
0ad65298ab Bring my pkg_install improvements forward from 2.1. 1995-11-12 04:55:40 +00:00
Jordan K. Hubbard
e804f03a5d Add support for the ${PKG_DBDIR} environment variable. /var/db/pkg is the
default, and probably not something you'd ever change, but now it's
possible to do so for local/custom installations.
1995-04-19 14:02:01 +00:00
Jordan K. Hubbard
8f396ebfb6 Many of John T. Kohl's patches from NetBSD. Thanks, John!
Submitted by:	jkohl
1994-12-06 00:51:50 +00:00
Jordan K. Hubbard
61f402e0c8 Don't let pkg_delete remove the recorded location until everything has
absolutely, positively been successfully removed.
Reviewed by:
Submitted by:
Obtained from:
1994-09-29 13:19:43 +00:00
Satoshi Asami
5edd12d270 The environment variable PKG_PREFIX is set to the first @cwd command
in the packing list, or the argument to -p if it is specified, before
the requirements/installation/deinstallation scripts are called.  This
enables the scripts to be written to work on the final installation
destination, even if the user uses -p to override the package's default.
1994-05-25 18:00:04 +00:00
Jordan K. Hubbard
6e27d75777 Fix problems with executing from current directory 1993-10-08 01:19:35 +00:00
Jordan K. Hubbard
a9c42a2388 Lots of misc tweaks, support for arbitrary separators in pkg_info, more
intelligent name handling in pkg_create.  Most of these files are changed
because of rcsid's being different in my cvs tree and freefall's (foo).
1993-09-03 23:01:17 +00:00
Jordan K. Hubbard
6d946b2e52 The release version of my package install suite. Please see man pages
for info.
1993-08-26 01:19:55 +00:00