History log of /freebsd-10.0-release/usr.sbin/pkg_install/create/perform.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

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


# 231328 09-Feb-2012 eadler

Fix r231300: Use correct test so we only bail out on error instead of on non-error.
Also, fix a style bug.

Submitted by: ache
Approved by: cperciva
MFC after: 1 month


# 231300 09-Feb-2012 eadler

Permit the use of relative paths for the prefix argument.
Remove an unnecessary cwd from created plists when -p is specified

PR: bin/145000
Submitted by: gcooper
Approved by: portmgr (flo)
MFC after: 1 month


# 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


# 213718 12-Oct-2010 flz

- Add support for xz compression to pkg_create, bzip2 remains the default
compression algorithm.
- Bump PKG_INSTALL_VERSION to 20101012.

Submitted by: mm
MFC after: 1 month


# 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


# 179352 27-May-2008 keramida

Add a -n option to pkg_create(1), to inhibit duplicate work.

When run without this option, multiple runs of `pkg_create -Rb' will
recreate common packages multiple times. This can take a lot of time
for large packages. With the -n option `pkg_create -b' checks with
stat(2) and skips packages that already exist.

Note that this may *not* be safe of the existing output file is not
really a package, or if it has been corrupted, modified or otherwise
tinkered with between subsequent pkg_create runs. For this and POLA
reasons, the default behavior is to *rebuild* the packages, and the -n
option can be used when we know it is `safe' to run in no-regenerate
mode.

Inspired by: A post to freebsd-questions
by Matthias Apitz &lt; matthias.apitz at oclc.org &gt;
Reviewed by: marcus, flz
Approved by: marcus
MFC after: 2 weeks


# 154102 07-Jan-2006 krion

When using @cwd %%FOO%%, we must ensure to return in the original
prefix later, but doing so with @cwd %%OLDPREFIX%% (having
PLIST_SUB+="OLDPREFIX=${PREFIX}") hardcodes the value in the packing
list. That's not really a problem when dealing with ports but that's
a problem with packages since pkg_add -p option only overrides the
first @cwd occurrence.

This patch allow us to use @cwd without any argument. If no
directory argument is given, it will set current working directory
to the first prefix given by the @cwd command.

PR: bin/77212
Submitted by: flz


# 152210 08-Nov-2005 krion

Introduce 3 new options for pkg_create(1), -x for using basic
regular expressions for pkg-name, -E for extended regexps and -G for
exact matching.

Submitted by: mux
MFC after: 3 days


# 147043 06-Jun-2005 sobomax

Add -R modifier for the mode when pkg_create(8) creates package file
from the locally installed package. When this modifier is specified
pkg_create(8) will also create package files for all packages on
which that locally installed package depends.

MFC after: 5 days


# 132789 28-Jul-2004 kan

Downgrade WARNS level to more tolerable value. Attempt to fix
casts as lvalue usage whenever possible.


# 131277 29-Jun-2004 eik

- pkg_create: new flag -S (clean room installation)

- pkg_create: checksum meta files too

PR: 66032


# 113594 17-Apr-2003 kris

* Add explicit conflict-checking to the package tools. Packages can
register a list of other packages with which they conflict (via the
-C option to pkg_create), and they will refuse to install (unless -f is
specified) if one of the listed packages is already present.

* Update documentation for the new feature as well as fleshing out some
existing documentation.

* Bump PKG_INSTALL_VERSION so this feature can be tested for.

Submitted by: Sergey Matveychuk <sem@ciam.ru>
PR: bin/47145
MFC after: 2 weeks


# 102384 24-Aug-2002 obrien

Reorg just a tad to better express our bzip intentions.


# 101338 04-Aug-2002 knu

Drop support for the .tbz2 suffix. One would not want pkg_create(1)
to create "pkgname.tbz" when one specifies "pkgname.tbz2".

MFC after: 1 week


# 101302 04-Aug-2002 obrien

Use an 8.3 friendly extension when compressing with bzip2.


# 96986 20-May-2002 sobomax

MFS: silence compiler warnings.


# 96392 11-May-2002 alfred

replace __FUNCTION__ with standardized __func__.

Requested by: jhb


# 96388 11-May-2002 alfred

fix build:
you may not use string concatination with __FUNCTION__, replace all occurances
of:
__FUNCTION__ ": error string"
with:
"%s: error string"


# 96300 09-May-2002 sobomax

When packing installed package into a file (pkg_create -b) make sure to
include all package files into resulting tarball.

PR: 34007
Submitted by: olgeni

While I here:

- Remove bogus comment;
- ensure that we return the proper exit code in the case of -b failure.

MFC after: 5 days


# 96076 05-May-2002 sobomax

New feature: allow origins of all dependencies be recorded into package list
using new `@comment DEPORIGIN:...' directive. This would allow us to make
many neat things including:

- easier binary upgrades;
- source upgrades without using external tools by simply extending
bsd.port.mk and pkg_install tools;
- mixed-mode upgrades (source + binary);
- depreciate and deorbit silly +REQUIRED_BY files in the near future.

This feature is no-op until appropriate bsd.port.mk patch is committed, and
even when it is already committed packages generated will remain 100%
compatible with old set of pkg_install tools (module all those neat
features, of course).

MFC after: 6 days


# 96066 05-May-2002 sobomax

Use PLIST_ORIGIN instead of rolling own version using PLIST_COMMENT.

MFC after: 6 days


# 95932 02-May-2002 sobomax

Kill local variable which shadows global one. This fixes creation of bzip2
compressed packages broken in the previous commit.

Pointy hat to: obrien


# 95161 20-Apr-2002 obrien

Improve the Bzip2 handling.

Sponsored by: FreeBSD Mall, Inc.


# 93520 01-Apr-2002 obrien

Fix SCM ID's.


# 90986 20-Feb-2002 sobomax

(forced)

Previous delta was a subject of:

MFC in: 1 week


# 90985 20-Feb-2002 sobomax

Provide protection against incorrect input (dependency list).

Submitted by: roam


# 89458 17-Jan-2002 sobomax

Pass `-9' flag to gzip(1), so that package is compressed using maximum
compression. Usually this gives gives extra 1-1.5%.

MFC after: 1 day


# 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


# 84671 08-Oct-2001 sobomax

(forced)

Forgot to mention: creation of a full-fleged package archive requires some
changes in bsd.ports.mk, because currently it doesn't install some files
that are usually packed into the package archive (+MTREE_DIRS, +DISPLAY
and so on). Support for this will be committed later.


# 84670 08-Oct-2001 sobomax

- Allow package archive to be created from a locally installed package. This
allows for an easy way to backup old version of port prior to installing
a new one;
- silence compiler warnings by killing some unused variables and adding
all includes necessary.

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


# 81571 13-Aug-2001 obrien

Reduce private "lesser known" function redirection to improve clarity.

Approved by: jkh


# 76739 17-May-2001 sobomax

Style policy: reformat multiline comments to conform to style(9).


# 74295 15-Mar-2001 sobomax

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


# 71373 22-Jan-2001 sobomax

- Add ability to handle bzip2-compressed packages;
- fix cosmetics to shut-up compiler in -pedantic mode (axe several unused vars
and provide default clause in several switch() statements).

No response from: -ports


# 71095 16-Jan-2001 sobomax

- Fix a nasty bug where pkg_create doesn't gzip package if lengh of package
name is less than 5 and doesn't contain recognizeable suffix (one of .tar or
.tgz), while gzip's it if lengh of the name greater than 4. For example
`pkg_create [options] pkg1' will create pkg1.tar, while
`pkg_create [options] pkg11' will create pkg11.tgz;
- use TRUE/FALSE as a values for boolean variables instead of explicit 1/0 and
erroneous YES in one case.

MFC candidate.


# 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


# 67429 22-Oct-2000 jkh

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>


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


# 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>


# 41530 05-Dec-1998 asami

Fix support for uncompressed (".tar") package types. It's not completely
fixed (chained dependency checking for pkg_add is broken, for one thing)
but at least you can now create one package and use it.


# 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>


# 38942 08-Sep-1998 jkh

o Set paths internally for pkg_add for tools we might want to invoke.
o Fix bogus suffix handling.
o Tell user when an FTP url is being xferred rather than being silent.
This sort of violates "the unix way" but it stops people from whacking
^C when they think it's hung, too. Sometimes visual indication of
success is important. Doesn't spit out anything if not on a TTY.


# 38933 08-Sep-1998 jkh

Fix bogus suffix stripping to be less naive.
PR: 3418
Noted by: pst


# 37914 28-Jul-1998 jkh

Don't exit() from cleanup() if we got there via a non-signal since
we're only going to exit (after printing a more detailed error message)
afterwards anyway.
PR: 7020


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


# 31166 13-Nov-1997 jkh

MF22: Revert part of -p handling.


# 31152 13-Nov-1997 jkh

The prefix override code was bogus. The original idea was sound
enough, but we're not using the pkg_create tool that way anymore
in the ports collection.

PR: 4894
Submitted by: Adrian Colley <aecolley@ois.ie>


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


# 27192 04-Jul-1997 jkh

Add proper md5 comments to ports-installed packages also by
masticating it through the same routine used by pkg_create.
Submitted by: se


# 26473 06-Jun-1997 jkh

Add support for srcdir overrides.


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


# 17338 30-Jul-1996 jkh

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.


# 16549 20-Jun-1996 jkh

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.


# 14728 20-Mar-1996 jdp

Close a file descriptor that I had (harmlessly) left open in a child
process.


# 13946 06-Feb-1996 jdp

Fixed pkg_create to eliminate the limits on the size of the PLIST.
Formerly, there were limits on both the number of files (hard-coded into
the program) and the number of characters (because of the ARG_MAX limit
in exec(2)). In this new version, the filenames are passed to tar through
a pipe, using tar's "-T" option, rather than on the command line.


# 11780 25-Oct-1995 jkh

Bring forward my changes from 2.1


# 8422 10-May-1995 jkh

Bump the number of allowable args by a factor of 4. I just scanned
all possible packing lists and found that at least one of them is
pretty large!


# 8419 10-May-1995 jkh

Re-work make_dist() routine to build the tar command more reasonably.
This should eliminate the problem with truncated packages.


# 8084 26-Apr-1995 jkh

Add a great deal more error checking to various things.


# 8078 26-Apr-1995 jkh

Yikes! How did that typo slip past! I'd swear I compiled it. Oh well,
thanks, Satoshi!

Embarrassed by: asami


# 8077 26-Apr-1995 jkh

As per Bruce's advice, use sysconf to get the max argument size and
dynamically allocate that much space, also using snprintf() and strncat()
to do proper bounds checking.


# 8051 24-Apr-1995 jkh

Use ARG_MAX instead of _POSIX_ARG_MAX: 4K is too small!
This should stop the SIGBUS errors in pkg_create for some packages.


# 8000 22-Apr-1995 jkh

Stage almost nothing through the playpen now - this should speed pkg_creates
up by a couple of factors, as well as decrease the amount of temporary space
required to build a package down to almost nothing.


# 7998 22-Apr-1995 jkh

Second round:

1. Make paths work correctly.
2. Make pkg_add generally more robust in the face of failure.
3. Make the depend messages come out on stderr or stdout, but not both
interspersed! :-)


# 7992 21-Apr-1995 jkh

Argh - missed a printf! That should be the last of plist-spewers.


# 7991 21-Apr-1995 jkh

Don't spew garbage into the packing list when PlistOnly and verbose are
both on. Whoops!


# 7986 21-Apr-1995 jkh

1. Add proper dependencies to the library in my Makefiles. This was pointed
out by Bruce.
2. Add a "feature" to pkg_create (OK, OK, it's a miserable hack!) to get
it to dump its internal packing list out so that the `fake-pkg' rule in
bsd.port.mk can generate a more meaningful packing list.


# 7733 10-Apr-1995 jkh

Neither of these tools really told you what you needed to know neatly
and succinctly in verbose mode. I hope people find this more to their
liking.


# 7713 09-Apr-1995 jkh

Add true support for dependency lists.

1. pkg_create now has a -P argument for specifying dependencies on the
command line.
2. pkg_add will honor dependencies and chain-load them automatically if
it finds the required package(s) in the same directory as the package
that is being loaded. For best results, install packages from a directory
containing all the packages you'll possibly need
(like /usr/ports/packages/all).

2 remaining flaws:

1. pkg_add looks in one place (where you were when you loaded the primary
pkg) for depended packages. If you can come up with a search path scheme
that's not a total hack - be my guest!

2. Recursive dependency expansion can result in the name of a dep being
listed more than once. This doesn't bother pkg_add since it checks
for package existance with pkg_info and will skip already-loaded packages.
I don't know how/if pkg_delete handles this yet, however. I need to look
into it.


# 4996 05-Dec-1994 jkh

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


# 4548 17-Nov-1994 jkh

Don't create packages with bogus @name lines.


# 3577 14-Oct-1994 jkh

This should do it - I forgot about pkg_info.


# 3363 04-Oct-1994 jkh

My last commit to bsd.port.mk made me think - `pkg_create -p ...' should
override the PLIST file's own first @cwd. Make this so.


# 2389 29-Aug-1994 adam

Allow creation of absolute package names
typo index() --> rindex() in order to split correct suffix
Fix @srcdir so it actually works
Submitted by: adam


# 1546 25-May-1994 jkh

Change in_plist() call to find_plist().


# 1520 19-May-1994 alm

Add `-h' option to force tar to follow symbolic links


# 478 18-Sep-1993 jkh

Doc new % sequence expansion for command execution.
Fixed bad verbose message.


# 447 12-Sep-1993 jkh

Whoops - got the exclude flag wrong, try again.


# 445 12-Sep-1993 jkh

Added and doc'd -X flag to pkg_create that allows you to specify an exclude
list for the final package.


# 383 05-Sep-1993 jkh

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


# 381 04-Sep-1993 jkh

Fixed bug in pkg_create that affected Rich's attempts to package emacs


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