History log of /freebsd-9.3-release/usr.sbin/pkg_install/add/main.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

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

# 254528 19-Aug-2013 gjb

MFC r254525:
Add entry for packages-9.2-release directory.

Approved by: re (implicit)


# 241976 24-Oct-2012 kensmith

MFC r241975: Add the release package directory for 9.1-RELEASE.


# 241135 02-Oct-2012 bapt

MFC r240682

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]


# 236462 02-Jun-2012 jpaetzel

MFC 236333,236336

Let pkg_add use the ENV variable PACKAGESUFFIX. This
can be used to override the default .tbz package extension to
.txz .tgz or .tar

Submitted by: kmoore
Obtained from: PC-BSD
Sponsored by: iXsystems


# 232436 03-Mar-2012 kensmith

Merge r232435:

> Add entry for packages-8.3-release directory.

Insta-merge because this is part of the prep work for branching releng/8.3
as part of doing 8.3-RC1.


# 230653 28-Jan-2012 eadler

MFC r229831:
- X11BASE has been deprecated for a long time and will die soon

Approved by: cperciva


# 229751 06-Jan-2012 kensmith

When copying/pasting a line to create a line you want to add make sure
to change all pieces of it, not just some of them.

Submitted by: A helpful soul on IRC
Pointy hat: me


# 229748 06-Jan-2012 kensmith

MFC the rest of r225757 that applies to the package set directories.


# 229304 02-Jan-2012 kensmith

The portion of r225757 that added the packages-9.0-release directory
was supposed to be MFCed closer to the release but that got missed.

Pointy hat: kensmith


# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 222035 17-May-2011 flz

Backout libinstall.a -> libpkg commit.

Discussed with: erwin, brooks, bapt


# 216665 22-Dec-2010 kensmith

Add package directories used for the upcoming 8.2 and 7.4 releases,
and catch up on a few from previous releases.


# 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


# 212029 30-Aug-2010 nwhitehorn

Use MACHINE_ARCH instead of MACHINE as the directory to fetch packages
from. Packages are architecture dependent, not machine dependent.


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


# 201226 29-Dec-2009 ed

Add missing `void' keywords.


# 196485 24-Aug-2009 kensmith

Oops. Needed to adjust a little bit more of the line for packages-8-stable
now that we're prepping for 8.0's release.

Submitted by: pluknet at gmail dot com
Pointy hat: kensmith


# 196432 22-Aug-2009 kensmith

Make head 9.0-CURRENT in preparation for lifting code freeze.

Approved by: re (implicit)


# 191110 15-Apr-2009 kensmith

Add release package directories for 6.4 and 7.2.


# 186494 25-Dec-2008 flz

Add package directory for 7.1-RELEASE in head as well as stable/7.


# 183979 17-Oct-2008 brooks

Display usage when pkg_add is called with no arguments.

PR: bin/121093
Submitted by: volker
Approved by: portmgr (linimon)
MFC after: 3 days


# 179835 16-Jun-2008 flz

Remove support for RELENG_4 (__FreeBSD_version < 500039).

MFC after: 1 day


# 179433 30-May-2008 flz

- Add long options to pkg_install.
- Remove check for '-?' as it's not listed in authorized options.
- Bump PKG_INSTALL_VERSION to 20080530.


# 176593 26-Feb-2008 kensmith

Sync list of directories to look for packages in to current releases
available.

MFC after: 3 days


# 173513 10-Nov-2007 krion

Add -i option for package installation without fetching and
installing its dependencies.

PR: bin/117065
Submitted by: Vladimir Ermakov <samflanker@gmail.com>
MFC after: 14 days


# 173412 07-Nov-2007 kevlo

Cleanup of userland __P use


# 172531 11-Oct-2007 kensmith

To honor the birth of RELENG_7 bump HEAD to 8.0-CURRENT.

Approved by: re (implicit)


# 166402 01-Feb-2007 pav

Fix previous rev.: don't step behind the end of memory we allocate


# 166374 31-Jan-2007 ade

Remove hard-coded limit (200) on maximum number of packages that can be
added with a single invocation of pkg_add, replacing it with something
rather more dynamic.

Approved by: portmgr (pav)
Tested by: full pointyhat package run
MFC after: 1 week


# 162802 29-Sep-2006 ru

Sync usage() with manpage's SYNOPSIS.


# 162663 26-Sep-2006 kensmith

Oops. Catch up on the last couple of releases and prepare for the next
one.


# 159554 12-Jun-2006 obrien

Allow variable amounts of verbosity.


# 156497 09-Mar-2006 phk

Add -F option to not fail on already installed packages.

Submitted by: Eugene Grosbein <eugen@grosbein.pp.ru>


# 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


# 152329 12-Nov-2005 krion

Add -P flag, it does the same as the -p option, except that the
given prefix is also used recursively for the dependency packages,
if any. If the -P flag appears after any -p flag on the
command line, it overrides it's effect, causing pkg_add to use the
given prefix recursively.

PR: bin/75742
Submitted by: Frerich Raabe <raabe AT kde DOT org>
MFC after: 3 days


# 151754 27-Oct-2005 murray

Look for packages in packages-6.0-release or packages-6-stable, as
appropriate.

Approved by: re (scottl@)
Reviewed by: portmgr (kris@)


# 147939 11-Jul-2005 kensmith

Fix an oops on FBSD-version for packages-5-stable I made in previous
commit.

Pointy hat: kensmith
Approved by: re (implicit)


# 147932 11-Jul-2005 kensmith

Prepare for packages-7-current. While here retro-fit packages-5.4-release
which probably should have been done a while ago.

Approved by: re (implicit)


# 143849 19-Mar-2005 marcus

Change the PATH for pkg_add to be the same used for pointyhat package builds.
This will give our users and porters a more consistent experience between
installing ports and installing packages.

Discussed with: portmgr


# 136616 17-Oct-2004 obrien

Set the real limits on 5-current, add 5-stable, add 6-current.


# 132789 28-Jul-2004 kan

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


# 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


# 129054 08-May-2004 bmah

Add 4.10 and 5.2.1 entries so that pkg_add -r fetches from the right
package sets.

PR: 66251
Submitted by: eik


# 126465 01-Mar-2004 kensmith

Add command line option for chrootdir, all pkg_add(8) operations will be
done inside of chroot(2) to chrootdir. Added to help with sysinstall(8)
support of install to alternate root but possibly useful for setting up
jails, etc.

No objection from: portmgr@
Style(9) abuse due to: entire program violates style(9)
Approved by: rwatson (mentor)


# 124054 01-Jan-2004 bmah

Catch up with reality with respect to the location of 4.8, 4.9,
5.0, 5.1, 5.2, and CURRENT packages.


# 104658 08-Oct-2002 bmah

Teach pkg_add -r how to find 4.7-RELEASE packages with an appropriate
osreldate.

(Actually, due to differences in package compression formats, I'm
not sure that a -CURRENT pkg_add -r will do the right thing in
this case, once it finds them.)


# 103155 09-Sep-2002 bmah

Fix minor off-by-one error.

Submitted by: jhb


# 103150 09-Sep-2002 bmah

Make pkg_install go to the right place for 4.6-RELEASE and 4.6.2-RELEASE
packages.

Pointed out by: obrien
Reviewed by: jhb


# 102383 24-Aug-2002 obrien

Find remaining hardcoded gzip bits and change to bzip2 bits.
Mark with XXX so someone that cares about being able to handle either
bziped or gziped packages knows where the remaining nits are.


# 93520 01-Apr-2002 obrien

Fix SCM ID's.


# 85023 16-Oct-2001 obrien

Increase the number of packages that can be installed by an order of
magnitude. Geez, this is Unix, what is with the arbitrary needless
constants.


# 84745 10-Oct-2001 sobomax

WARNS=2 cleanup.

Tested on: i386, alpha
MFC after: 2 weeks


# 83573 17-Sep-2001 sobomax

Fix segfault introduced in previous commit (when adding local packages).


# 83212 07-Sep-2001 unfurl

Fixes problem with pkg_add -r when adding multiple pkgs.

Reviewed by: chris


# 81571 13-Aug-2001 obrien

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

Approved by: jkh


# 80472 28-Jul-2001 obrien

The security officer requested this be backed out for discussion.


# 80463 27-Jul-2001 obrien

Remove s_strl*(). I am not sure what was thought they accomplished.

When reading the code I had to stop, say "ok, what does *these*
modifications of strl*() do? Pull out grep. Oh, not in add/, maybe above
in ../lib/? Yep. So what do they do? Comments above them are misleading,
guess I'll have to read the code. Oh, they just test strl* against the
size and return the result of the test. Now I can continue to read the
code I was.

The uses of s_strl*() then test that result and errx()'s.
Lets think about the "optimized" code I am removing:

In general the compiler pushes the three args to strl* onto the stack and calls
s_strl*. s_strl* has to indirectly access 3 args from the stack. Then push
them on the stack a 2nd time for the real strl* call. s_strl* then pops the
return from strl* off the stack; or moves it from the register it was returned
in, to the register where tests can happen. s_strl* then pops the three
arguments to strl*. Perform the test, push the result of the test, or move it
from the result register to the return value register. The caller to s_strl*
now has to either pop the return value of s_strl* or move it from the return
value register to the test register. The caller then pops the three args to
s_strl* off the stack (the same args that s_strl* itself had to pop off after
the real call to strl*). The s_strl* caller then performs a simular test to
what has already been done, and conditionally jumps. By doing things this way, we've given the compiler optimizer less to work with.

Also, please don't forget the that call to s_strl* has possibly jumped to code
not in the cache due to being far away from the calling code, thus causing a
pipeline stall.

So where is the "optimization" from s_strl*?
It isn't code clarity.
It isn't code execution speed. It isn't code size either.


# 80409 26-Jul-2001 kris

Only match the first osreldate date range for constructing the FTP URL,
not all of them.

Noticed by: obrien


# 79916 19-Jul-2001 kris

Correct a reversion in r1.39 which introduced a new instance of strcpy()
after r1.38 had attempted to remove them all.


# 79536 10-Jul-2001 sobomax

bzip2(1) is in the base system - we don't need /usr/local/bin in the PATH
anymore.


# 77730 04-Jun-2001 pirzyk

Fixed pkg_add so when it does not find a package, it returns != 0.

PR: bin/23083
Submitted by: Patch submitted by Maxime Henrion <mux@qualys.com>
MFC after: 2 weeks


# 76504 12-May-2001 kris

Clean up some of the evil string handling in this code, replace
warnx()+exit() with errx() and replace a big if..then..else construct
to determine the package download directory with a lookup table.

Reviewed by: jkh
MFC after: 2 weeks


# 76392 08-May-2001 obrien

rcsid style fix.


# 76391 08-May-2001 obrien

A WIP snuck in the rev 1.34 commit.


# 76015 26-Apr-2001 ache

Fix typo in prev commit - add missing comma


# 75981 25-Apr-2001 obrien

Add /usr/X11R6/bin to the exported PATH. If /usr/local/bin is there,
/usr/X11R6/bin should be there. This helps all the ports that need to
run `mkfontdir' and error out as many port maintainers do not realize
`mkfontdir' isn't in the path.

Prompted by: pkg_add pcemu


# 72578 17-Feb-2001 obrien

MFS: getpackagesite() from RELENG_4 that allows the code to be the same.


# 72430 13-Feb-2001 obrien

In light of the dismal transfer times from ftp.FreeBSD.org, add a new
`PACKAGEROOT' env var which you would set to a proper mirror of
ftp.FreeBSD.org (say "export PACKAGEROOT=ftp://ftp3.FreeBSD.org"), to
fetch from an alternate place. This is easier to use than `PACKAGESITE'
for true mirrors, and can be used in your dot files across all versions
of FreeBSD.


# 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


# 58010 13-Mar-2000 billf

-CURRENT is now 500000, reflect that.


# 53388 18-Nov-1999 cpiazza

Make `pkg_add -r package1 package2 package3 ...` work correctly.

Reviewed by: billf


# 51638 25-Sep-1999 billf

o Remove all of the objformat logic, it's never coming back.
o Simplify getpackagesite(), it comes back in full glory when we branch
again. It's still needed however to get the i386 or alpha directory.


# 50479 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 48170 24-Jun-1999 imp

'?' shouldn't be in the usage string. Unknown characters are already
converted to '?'.


# 48143 23-Jun-1999 billf

If we are going to have a case for '?' then we should define it in Options.

Submitted by: Ben Olson <bseth@chc-chimes.com>


# 47916 14-Jun-1999 obrien

Support Alpha and -CURRENT in the "-r" option case.


# 43359 28-Jan-1999 billf

Fix nasty bug where getpackagesite() will return an integer if it doesn't
know what revision of FreeBSD is being run. This case should never happen,
but just in case.


# 43244 26-Jan-1999 billf

Numbering typo, missed a '0'

Submitted by: Brian Feldman


# 43204 25-Jan-1999 billf

Update pkg_add's remote package feature to reflect the new structure of
wcarchive. This needs to be updated when:

(a) The directory structure changes on wcarchive
(b) getosreldate() has a new significance
(ie. get ELF packages/get a.out packages)
(c) Branches are changed around

As we stand right now, 3.0-postELFday and 4.0-x all point to the same
directory, but when 4.0 starts to have its own packages, this file will
need to be changed.


# 42786 18-Jan-1999 billf

Style police, inline ifs.

Submitted by: Brian Feldman <green@unixhelp.org>


# 42740 16-Jan-1999 billf

Add a new option for pkg_add, -r.

The remote option allows for automatic package fetching and installation
using the package repository found on wcarchive. Naturally, this site
can be overridden with a enviornment variable.

This code uses getobjformat() and getosreldate(). This means when some event
causes the package to be fetched to change (such as e-day) the logic also
needs to be changed.

Sorta reviewed by: jkh
Code suggestions: peter, jkh, eivind, msmith


# 39185 14-Sep-1998 jkh

Use a more reasonable default umask in case the root umask is too
fascist.
PR: 4014


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


# 30221 08-Oct-1997 charnier

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


# 29574 18-Sep-1997 phk

Many places in the code NULL is used in integer context, where
plain 0 should be used. This happens to work because we #define
NULL to 0, but is stylistically wrong and can cause problems
for people trying to port bits of code to other environments.

PR: 2752
Submitted by: Arne Henrik Juul <arnej@imf.unit.no>


# 24428 31-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


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


# 14582 12-Mar-1996 jkh

Fix a couple of miscellaneous bugs and make pkg_add also support reading
from stdin.


# 12219 12-Nov-1995 jkh

Bring my pkg_install improvements forward from 2.1.


# 11780 25-Oct-1995 jkh

Bring forward my changes from 2.1


# 8857 30-May-1995 rgrimes

Remove trailing whitespace.


# 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


# 465 14-Sep-1993 jkh

Fixed broken -t flag; thanks Rich!


# 382 05-Sep-1993 jkh

Made staging area configurable rather than assuming /tmp (-t)
Made pkg_add -n less bitchy.
Made -p in pkg_add override "default" package location in pkg_create.

Added concept of "slave" and "master" modes, allowing many different things
to be done to packing lists on the fly. This is really something for
front-end drivers to use, but also something for the more expert user.

rename()'ing files before trying to copy them, thus saving
considerable time when targets and staging area are on same filesystem.


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