Commit Graph

22 Commits

Author SHA1 Message Date
Pav Lucistnik
2b520e6990 - Restore functionality broken in previous commit; we need to be able to report
multiple installed packages with the same PKGORIGIN.

Reported by:	marcus
MFC after:	1 month
2008-05-03 22:56:50 +00:00
Pav Lucistnik
42b1030bbd Optimize package registration/deregistration. Previously, when looking up the
package name for the origin of a dependency, all entries in /var/db/pkg were
traversed for each dependency of added/removed package.  Now, gather all the
origins first, then do the lookup in a single pass over /var/db/pkg.

This should provide a major speedup for packages with hundreds of dependencies.

Submitted by:	rdivacky (earlier version)
MFC after:	1 month
2008-04-11 08:26:06 +00:00
Kirill Ponomarev
2704bd0e13 Momoize the results of isinstalledpkg()
PR:		bin/116452
Submitted by:	wollmann
MFC after:	7 days
2007-11-02 20:18:47 +00:00
Kirill Ponomarev
37e9053e23 Do not bitch about bsdpan modules not having origin.
Based on PR:	bin/82269
Submitted by:	Steven Hartland <killing at multiplay dot co dot uk>
MFC after:	3 days
2005-09-24 21:41:47 +00:00
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
Jens Schweikhardt
ecc68fbe47 Fix a case of undefined behavior due to overlapping buf objects in
snprintf (buf, size, fmt, buf, etc). This only works by chance with our
libc, but fails (with a truncated string) on e.g. glibc.

Okayed by:	sobomax
MFC after:	1 week
2003-12-23 15:01:12 +00:00
Bosko Milekic
d8af834050 Backout 1.14, it seems to be causing problems with libxml build
and I don't have time to investigate this code in much detail right
now.
2003-08-04 03:02:36 +00:00
Bosko Milekic
1d324ddef8 Use strncmp() and not strcmp() here to properly match
installed ports.

Submitted by: Harold Gutch <logix@foobar.franken.de>
2003-08-01 17:26:41 +00:00
Garrett Wollman
0d3bcc2e80 Make the threatened fts(3) ABI fix. FTSENT now avoids the use of the struct
hack, thereby allowing future extensions to the structure (e.g., for extended
attributes) without rebreaking the ABI.  FTSENT now contains a pointer to the
parent stream, which fts_compar() can then take advantage of, avoiding the
undefined behavior previously warned about.  As a consequence of this change,
the prototype of the comparison function passed to fts_open() has changed
to reflect the required amount of constness for its use.  All callers in the
tree are updated to use the correct prototype.

Comparison functions can now make use of the new parent pointer to access
the new stream-specific private data pointer, which is intended to assist
creation of reentrant library routines which use fts(3) internally.

Not objected to in spirit by: -arch
2002-09-21 01:28:41 +00:00
Maxim Sobolev
6950a26a50 Eliminate free'ing already freed chunks.
MFC after:	1 week
2002-05-22 10:33:25 +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
David E. O'Brien
0d8875ff46 Fix SCM ID's. 2002-04-01 09:39:07 +00:00
Maxim Sobolev
d100deb8cc WARNS=2 cleanup.
Tested on:	i386, alpha
MFC after:	2 weeks
2001-10-10 06:58:42 +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
a153062b97 Use reallocf(3) to increase size of malloc'ed buffer instead of
malloc()+memcpy()+free().
2001-07-20 13:20:32 +00:00
Maxim Sobolev
c805813625 - Add which(1)-like functionality into pkg_info;
- fix a harmless bug in match_installed() function introduced in my last
  commit;
- uniformely reorder includes across files.

Submitted by:		Garrett Rooney <rooneg@electricjellyfish.net>
Not objected by:	jkh, -ports
2001-03-23 18:45:24 +00:00
Maxim Sobolev
6f8e863b0f When matching installed packages against glob keep track of which patterns
actually triggered a match and which did not, and add patterns that didn't
into resulting list, so caller will have a chance to notify user that package
isn't installed. This should fix current, POLA-breaking behaviour when user
doesn't receive a notification if he specifies several packages, some of which
aren't installed.
2001-03-14 19:46:43 +00:00
Maxim Sobolev
79f0014dd5 Properly detect and report malloc(3) failures. 2001-02-27 11:15:04 +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