History log of /freebsd-10.1-release/usr.sbin/pkg_install/lib/match.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 228990 30-Dec-2011 uqs

Spelling fixes for usr.sbin/


# 222035 17-May-2011 flz

Backout libinstall.a -> libpkg commit.

Discussed with: erwin, brooks, bapt


# 206043 01-Apr-2010 flz

Various fixes.

- Replace hardcoded INDEX version. [1]
- Fix a buffer overlap. [2]
- Remove empty package when fetching fails and -K is used. [3]
- Remove useless chmod2() after mkdtemp(3). [4]
- Replace mkdir(1) call with mkdir(2). [5]
- Get rid of some vsystem() calls.
- Switch from lstat(2) to open(2) in fexists().
- Try rename(2) in move_file() first.
- Bump PKG_INSTALL_VERSION to 20100401.

PR: bin/145101 [1], bin/139492 [2], bin/144919 [3]
bin/144920 [4], bin/144921 [5]
Submitted by: gcooper [1,2,3,4,5]


# 178753 03-May-2008 pav

- 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


# 178103 11-Apr-2008 pav

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


# 173291 02-Nov-2007 krion

Momoize the results of isinstalledpkg()

PR: bin/116452
Submitted by: wollmann
MFC after: 7 days


# 150530 24-Sep-2005 krion

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


# 131285 29-Jun-2004 eik

- 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


# 131280 29-Jun-2004 eik

- 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


# 131275 29-Jun-2004 eik

- 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


# 123770 23-Dec-2003 schweikh

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


# 118410 04-Aug-2003 bmilekic

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.


# 118313 01-Aug-2003 bmilekic

Use strncmp() and not strcmp() here to properly match
installed ports.

Submitted by: Harold Gutch <logix@foobar.franken.de>


# 103726 20-Sep-2002 wollman

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


# 97097 22-May-2002 sobomax

Eliminate free'ing already freed chunks.

MFC after: 1 week


# 96613 14-May-2002 sobomax

- 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


# 96392 11-May-2002 alfred

replace __FUNCTION__ with standardized __func__.

Requested by: jhb


# 93520 01-Apr-2002 obrien

Fix SCM ID's.


# 84745 10-Oct-2001 sobomax

WARNS=2 cleanup.

Tested on: i386, alpha
MFC after: 2 weeks


# 81049 02-Aug-2001 sobomax

Cosmetics: replace dozen instances of "(tmp = getenv(PKG_DBDIR) ? tmp : DEF_LOG_DIR)"
with macro.

MFC after: 1 month


# 80043 20-Jul-2001 sobomax

Forgot to mention that previous commit (1.4 --> 1.5) would be:

MFC after: 2 weeks


# 80042 20-Jul-2001 sobomax

Use reallocf(3) to increase size of malloc'ed buffer instead of
malloc()+memcpy()+free().


# 74699 23-Mar-2001 sobomax

- 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


# 74258 14-Mar-2001 sobomax

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.


# 73144 27-Feb-2001 sobomax

Properly detect and report malloc(3) failures.


# 73134 27-Feb-2001 sobomax

- 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