History log of /freebsd-10.1-release/usr.sbin/pkg_install/info/perform.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


# 240682 18-Sep-2012 bapt

if a file in plist starts with / then do not prefix it with "prefix" [1]
pkg info -g returns 1 if a file mismatch [2]
flush stdout in pkg info -g [3]
clean up quiet mode (-q | --quiet) output of pkg_version(1) [4]
fix missing error call in uname check added to pkg_version(1) [5]
fix pkg_add(1) fails to install with -C from bad path [6]
only resolve path from pkg_add(1) -p if the given prefix do not start with a '/' [7]

PR: bin/13128 [1]
bin/139015 [2]
bin/113702 [3]
bin/142570 [4]
bin/146857 [5]
bin/157543 [6]
Submitted by: cy [1]
Anton Yuzhaninov <citrin@citrin.ru> [2]
Ighighi <ighighi@gmail.com> [3]
"N.J. Mann" <njm@njm.me.uk> [4]
gcooper [5]
David Naylor <naylor.b.david@gmail.com> [6]
netchild [7]
MFC after: 2 weeks


# 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


# 207113 23-Apr-2010 flz

- Take libinstall.a out of pkg_install and make it a proper shared library.
- Rework the wrapper support to check libpkg version as well as pkg_install
version.
- Add libfetch to _prebuild_libs.
- There are no new features introduced.

Notes: the API is not stable, so basically, do not use libpkg in your
projects for now. Also there's no manpage for libpkg yet, because the API
will change drastically. I repeat, do not use libpkg for now.


# 194497 19-Jun-2009 brian

When running pkg_add -r, check & install our dependencies for each
package rather than expecting our top level package to get all of
the dependencies correct.

Previously, the code depended on the top level package having all
of the pkgdep lines in +CONTENTS correct and in the right order,
but that doesn't always happen due to code such as this (in
security/gnutls/Makefile):

.if (defined(WITH_LZO) || exists(${LOCALBASE}/lib/liblzo2.so)) && !defined(WITHOUT_LZO)
LIB_DEPENDS+= lzo2:${PORTSDIR}/archivers/lzo2
....

With such conditional dependencies, my 'sophox-packages' package won't
install. The dependency tree looks like this:

sophox-packages
...
x11/gnome2
x11/gnome-applets
net/libgweather
devel/libsoup
security/gnutls
security/libgcrypt
security/libgpg-error
...
x11/gnome2
archivers/file-roller
archivers/gtar
archivers/lzop
archivers/lzo2
...

gnutls doesn't depend on lzo2 initially, but lzo2 is dragged into the
mix via other dependencies and is built by the initial 'make'. The
subsequent package generation for gnutls adds a pkgdep line for lzo2
to gnutls' +CONTENTS but the pkgdeps in sophox-packages' +CONTENTS
has gnutls *before* lzo2.

As a result, sophox-packages cannot install; gnutls fails because lzo2
is missing, 82 more packages fail because gnutls is missing and the
whole thing spirals into a super-confusing mess!

MFC after: 3 weeks


# 178246 16-Apr-2008 flz

Fix pkg_info when specifying a remote package.

MFC after: 1 week


# 154145 09-Jan-2006 flz

Add -K option to pkg_add and pkg_info.
This option saves packages to PKGDIR (if defined or current directory by default)
as they are downloaded.
Silent a warning when -n is used and package has a +DISPLAY file.

Approved by: krion
MFC after: 1 week


# 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


# 112572 24-Mar-2003 mdodd

Implement the 'Q' option which is like 'q' (quiet output) except
that it prefaces the output with the package name.

This is useful for things like this:

# pkg_info -Qsa | awk -F : '{print $2 "\t" $1}' | sort -rn | expand -t 10


# 103116 09-Sep-2002 sobomax

Use --fast-read mode to extract metadata from package file. Since metadata
files are located at the very beginning of the package, this patch in
conjuction with latest tar(1) --fast-mode fix greatly speeds up pkg_info(1)
operation on package files.

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


# 96075 05-May-2002 sobomax

In a origin lookup mode (-O) don't bail out when encountering empty package
directory, because this prevent this option from being used from the
package-depends target of bsd.port.mk since it creates such empty dir
during its normal operation.

MFC after: 6 days


# 96031 04-May-2002 sobomax

(forced)

Previous delta (pkg_info -O) is subject of:

MFC after: 1 week


# 96030 04-May-2002 sobomax

Add ability to query installed packages based on origin.


# 93520 01-Apr-2002 obrien

Fix SCM ID's.


# 84750 10-Oct-2001 sobomax

- Introduce a notion of `packing list format version'. This allows making
non-backward compatible changes in the format of packing list and handle
them gracefully;
- fix a longstanding issue with symlinks handling. Instead of recording
checksum for the file symlink points to, record checksum for the value
returned by readlink(2). For backward compatibility increase packing list
format minor version number and provide a fallback to a previous behaviour,
if package in question was created with older version of pkg_* tools;

Submitted by: Alec Wolman <wolman@cs.washington.edu>, sobomax

- don't record MD5 checksum for device nodes, fifo's and other non-regular
files.

Submitted by: nbm
MFC in: 2 weeks


# 84745 10-Oct-2001 sobomax

WARNS=2 cleanup.

Tested on: i386, alpha
MFC after: 2 weeks


# 83663 19-Sep-2001 sobomax

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


# 81049 02-Aug-2001 sobomax

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

MFC after: 1 month


# 81046 02-Aug-2001 sobomax

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


# 74809 26-Mar-2001 sobomax

Decapitalise first letter of warning message.


# 74808 26-Mar-2001 sobomax

In which(1) mode resolve "/../", "/./" in arguments and PLIST contents. This
is done without realpath() to avoid symlinks resolving.

Submitted by: sobomax, Garrett Rooney <rooneg@electricjellyfish.net>


# 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


# 73276 01-Mar-2001 sobomax

Put back several lines that I erroneously deleted in my previous commit. This
should fix recent segfault of `pkg_info -e'.

Submitted by: Garrett Rooney <rooneg@electricjellyfish.net>, knu


# 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


# 72174 08-Feb-2001 sobomax

- By default treat supplied arguments as a shell globs to be matched against
names of installed packages;
- add new `-G' option to disable glob matching and revert to previous
behaviour (I have no idea why this could be necessary, though);
- add a new `-x' option, which instructs pkg_info(1) to treat supplied
arguments as a regular expressions.

For example:
$ pkg_info foo\* - displays information about all packages whose names start
from foo
$ pkg_info -G foo\*-1.1 - displays information about package named "foo*-1.1"
$ pkg_info -x ^foo.\* - displays information about all packages whose names
start from foo

Original idea submitted by: Edwin Groothuis <mavetju@chello.nl> (bin/24695)
Reviewed by: jkh, roam
Approved by: jkh


# 71965 03-Feb-2001 jkh

Add a -g flag for verifying an installed package against its recorded
checksums (to see if it's been modified post-installation). Naturally,
this mechanism is only as secure as the contents of /var/db/pkg if you're
using it for auditing purposes.

Submitted by: Roman Shterenzon <roman@xpert.com>


# 67454 23-Oct-2000 sobomax

Add "-o" option to pkg_create(1) and pkg_info(1). This option intended to record
a path of the port from which package has been created within FreeBSD Ports
Collection and will be used to improve pkg_version(1) and similar tools.

Reviewed by: ports@FreeBSD.org, jkh
Approved by: jkh


# 66339 25-Sep-2000 marko

Make the ``-r'' option actually do something :)
Also tidy up it's output.

Approved by: jkh


# 62775 07-Jul-2000 sobomax

New option "-s" to query size of the installed package(s).

PR: 19445
Submitted by: sobomax
Reviewed by: knu
Approved by: silence


# 50479 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 49637 11-Aug-1999 billf

-Wall fixes. Ambigious if/elses, uninitialized values, missing headers,
missing prototypes, and empty format strings.


# 49300 30-Jul-1999 jdp

When listing the installed packages, do it in alphabetical order.


# 41866 16-Dec-1998 jkh

Make it possible to have separate install scripts as well as have
an on-delete script.

Submitted by: Rajesh Vaidheeswarran <rv@fore.com>


# 39068 11-Sep-1998 jkh

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>


# 33427 16-Feb-1998 jkh

Eliminate the idea of nested "playpens" entirely - it just obfuscated
the code and, in at least one case, made it more dangerous to no gain.


# 30387 13-Oct-1997 jkh

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>


# 30221 08-Oct-1997 charnier

Use err(3). Cosmetics in usage string and man page.


# 22997 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 21673 14-Jan-1997 jkh

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.


# 16404 16-Jun-1996 jkh

Make a small optimization which shaves about a second off the time
it takes to build the `All' menu in configPackages.


# 11780 25-Oct-1995 jkh

Bring forward my changes from 2.1


# 9782 29-Jul-1995 ache

You can run pkg_info everywhere expect /var/db/pkg directory :-)
Running there you got any kind of strange errors from tar caused
by treating directories as tar files!
Fix it by adding new isfile(name) (check for reg. files) to simple fexists(name) calls.


# 8857 30-May-1995 rgrimes

Remove trailing whitespace.


# 8423 10-May-1995 jkh

Fix a long-standing bug that broke pkg_info utterly and probably made
pkg_add a little wiggy too. Document the fact that pkg_info can also
take a URL.


# 8142 28-Apr-1995 jkh

Whoops! One of my automatics was initialized to garbage. Fix it.


# 8086 26-Apr-1995 jkh

Make pkg_info URL aware (and also make it use the PKG_PATH properly, like
everyone else). Try this:
pkg_info ftp://freebsd.org/pub/FreeBSD/packages/all/gmake-3.73.tgz


# 7937 19-Apr-1995 jkh

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.


# 5399 04-Jan-1995 swallace

Added new function show_index() which does a 'smart' display of the index file.
Index descriptions are limited to MAXINDEXSIZE (60) chars. Any description
beyond that is truncated. Also, only the first line is displayed as well.
This allows pkg_info -a -I to be formated in two columns with one line
per package for easy reading.

Reviewed by: jkh


# 4996 05-Dec-1994 jkh

Many of John T. Kohl's patches from NetBSD. Thanks, John!
Submitted by: jkohl


# 3579 14-Oct-1994 jkh

Sigh. NOW it's ok! :-)


# 3577 14-Oct-1994 jkh

This should do it - I forgot about pkg_info.


# 3364 04-Oct-1994 jkh

Add the ability to verify that a package won't extract in the space
available. Thanks to Michael Elbel for pushing me in the right direction.


# 411 07-Sep-1993 jkh

Added two new options, one of which is fairly far reaching:

-q turns on "quiet" mode, where informational headers and such are not
dumped, just the information.

-L Shows full pathnames of files comprising a package. With -q,
this can be useful for doing fileset operations, such as
"du -s `pkg_info -q -L foo_bin`" to see how much space package
"foo_bin" is taking up.


# 405 06-Sep-1993 jkh

Nailed one last lurking ^L.


# 392 05-Sep-1993 jkh

Added -e flag to pkg_info. Now you can test to see whether a package
is installed or not rather easily (useful for install scripts that want
to check for prerequisite packages). See man page for details.


# 383 05-Sep-1993 jkh

Made staging area configurable rather than assuming /tmp (-t)


# 379 03-Sep-1993 jkh

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).


# 328 25-Aug-1993 jkh

This commit was generated by cvs2svn to compensate for changes in r327,
which included commits to RCS files with non-trunk default branches.


# 327 25-Aug-1993 jkh

The release version of my package install suite. Please see man pages
for info.