Commit Graph

202 Commits

Author SHA1 Message Date
Florent Thoumie
2eb4b00cbb Backout libinstall.a -> libpkg commit.
Discussed with:	erwin, brooks, bapt
2011-05-17 19:11:47 +00:00
Florent Thoumie
762c7db2e8 - 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.
2010-04-23 11:07:43 +00:00
Florent Thoumie
b2d7e80ed1 Bump PKG_INSTALL_VERSION to 20100403. 2010-04-03 10:57:13 +00:00
Florent Thoumie
fc6d543f21 Fix pkg_delete, check if the file we're trying to delete is a
symlink before complaining that it doesn't exist. Typical case
would be a leftover library symlink that's left over after the
actual library has been removed.

Reported by:	tabthorpe
2010-04-03 10:55:11 +00:00
Florent Thoumie
094f117522 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]
2010-04-01 14:27:29 +00:00
Florent Thoumie
7735b3839a - Add support for UPDATING remote fetching.
- Reorganize EXAMPLES section in pkg_updating(1).
- Style fixes.
- Bump PKG_INSTALL_VERSION to 20100122.

Submitted by:	beat
MFC after:	1 week
2010-01-22 23:32:10 +00:00
Florent Thoumie
9e545c0216 - Bump PKG_INSTALL_VERSION to 20090902 after dougb's changes.
- Change the comment to say that version must be changed when a
non-cosmetic change is made.
2009-09-02 13:58:15 +00:00
Doug Barton
9e2bcb5a69 Add support for INDEX-9 [1]
While I'm here, strip off support for FreeBSD 5.x.

Submitted by:	Alexey Shuvaev <shuvaev@physik.uni-wuerzburg.de> [1]
2009-08-31 17:50:33 +00:00
Brian Somers
ef26f51cb1 Don't imply that only FTP urls are supported when we can't fetch
a package.

Approved by:	re (kib)
MFC after:	3 weeks
2009-06-30 20:53:57 +00:00
Brian Somers
f345b422d1 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
2009-06-19 17:07:38 +00:00
Florent Thoumie
aa33fa5a86 Skip @pkgdep if there's no argument.
Submitted by:	pav
MFC after:	1 week
2009-05-19 14:26:41 +00:00
Florent Thoumie
853e670bb4 - Backout latest changes (follow symlinks: r186496, r186518).
- Bump PKG_INSTALL_VER to 20090106.
2009-01-06 19:00:12 +00:00
Florent Thoumie
7e410be8f0 Fix memory leaks introduced in last commit.
Bump version to 20081227.

Reported by:	gcooper
Submitted by:	Andrea Barberio <insomniac@slackware.it>
MFC after:	1 month
2008-12-27 14:34:33 +00:00
Florent Thoumie
58d93e6134 Follow symlinks when deleting directories.
Bump PKG_INSTALL_VER to 20081225 (Merry Christmas \o/).

PR:		bin/54446
Submitted by:	Andrea Barberio <insomniac@slackware.it>
MFC after:	1 month
2008-12-25 16:59:35 +00:00
Poul-Henning Kamp
419859bd08 Use humanize_number to report pen-sizes so people don't have to count
the digits when trying to install openoffice.
2008-08-07 14:48:35 +00:00
Giorgos Keramidas
ce489a99f0 Enable the -n option of pkg_create(1).
The changes to make the option work are already in place, but I missed
the patch hunk that adds it to the getopt() option-handling loop.

Pointy hat:	keramida
Approved by:	flz
MFC after:	1 week
2008-07-08 03:21:05 +00:00
Florent Thoumie
74572e9e63 Remove support for RELENG_4 (__FreeBSD_version < 500039).
MFC after:	1 day
2008-06-16 23:41:11 +00:00
Florent Thoumie
c55100c9ba - add: Keep dependent packages too if -K is specified.
- updating: terminating '\n' is not part of the package origin.
- bump PKG_INSTALL_VERSION to 20080612.

PR:		bin/119368 [1], bin/124459 [2]
Submitted by:	gcooper [1], Beat Gatzi <beat@chruetertee.ch> [2]
MFC after:	3 days
2008-06-12 15:21:13 +00:00
Florent Thoumie
0b99032d09 - Add long options to pkg_install.
- Remove check for '-?' as it's not listed in authorized options.
- Bump PKG_INSTALL_VERSION to 20080530.
2008-05-30 14:26:09 +00:00
Florent Thoumie
6182e1eeee Bump PKG_INSTALL_VERSION to 20080528.
X-MFC after:	latest HEAD changes have been MFC'ed to RELENG_[67]
2008-05-28 13:48:10 +00:00
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
01ea2a8822 Some code cleanups, including removing of stale getopt argument and
hardcoded +CONTENTS defines.

PR:		bin/117855
Submitted by:	Beat Gaetzi <beat@chruetertee.ch>
MFC after:	14 days
2007-11-10 10:21:29 +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
9f0626a570 Add whitespace. 2007-10-17 13:47:10 +00:00
Kirill Ponomarev
e619861f5e Update for INDEX-8 support. 2007-10-17 13:45:43 +00:00
Pav Lucistnik
217176a40c - Replace rather inefficient bubble sort with a recursive depth-first search.
This speeds up registration of packages considerably.
- style(9) police welcome!

PR:		bin/112630
Submitted by:	Stephen Montgomery-Smith <stephen@cauchy.math.missouri.edu>
Tested by:	bento i386 experimental run
MFC after:	14 days
2007-06-18 22:49:13 +00:00
Nate Lawson
92931013f6 Make consistent with style(msmith). 4 spaces indent, tab for each 2 indents. 2007-03-28 05:33:52 +00:00
Ruslan Ermilov
d73d2e1de2 Invoke tar(1) with the -p option when installing a package
from an URL (i.e., do it the same way as when installing
from a file).  This fixes the lossage of the setuid bits.
It wasn't a problem before because GNU tar(1) implied the
-p option for root, but BSD tar(1) doesn't do that.

Discussed with:	tobez and some advanced users :)
2007-03-06 14:54:45 +00:00
Dag-Erling Smørgrav
b21860b5d0 Cosmetic: fix indentation. 2006-08-11 17:17:14 +00:00
Dag-Erling Smørgrav
ccbca788b3 Turn on libfetch debugging if -v was specified on the command line.
MFC after:	2 weeks
2006-07-08 14:34:56 +00:00
David E. O'Brien
3b26c608f8 Allow variable amounts of verbosity. 2006-06-12 22:39:32 +00:00
Kirill Ponomarev
69b1a1dece Add INDEX-7 and remove trailing spaces.
MFC after:	5 days
2006-04-17 11:15:29 +00:00
Florent Thoumie
cd2407daad 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
2006-01-09 18:27:21 +00:00
Kirill Ponomarev
ce036f4091 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
2006-01-07 22:10:58 +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
John-Mark Gurney
522738a9a4 remove a few uses of the word `really'
Reviewed by:	hrs
Approved by:	re (scottl)
MFC after:	1 week
2005-06-27 17:10:22 +00:00
Kirill Ponomarev
c554b6316d Implement @noinst field which has at the moment the same meaning and
function as @comment has.  But will be valid only for files and not
for md5 sums, rcsid's and comments in the future.

Submitted by:	flz
Approved by:	re@ (scottl)
2005-06-14 15:05:43 +00:00
Paul Richards
b134a8b672 Use INDEX-6 for versions of FreeBSD > 600000 2005-01-04 16:18:55 +00:00
Ruslan Ermilov
a35d88931c For variables that are only checked with defined(), don't provide
any fake value.
2004-10-24 15:33:08 +00:00
David E. O'Brien
f4a324ac51 Add a -q flag to pkg_version. It suppresses the output of <,=,>.
This makes it possible to "portupgrade `pkg_version -q -l '<'`".
2004-10-18 05:34:54 +00:00
Ruslan Ermilov
7d5cc1cf59 Don't put DEBUG to CFLAGS, we have the standard DEBUG_FLAGS for this. 2004-08-12 20:06:01 +00:00
Stefan Farfeleder
14cc87e479 Use the length modifier 'll' instead of 'q' to print long longs. 2004-07-28 16:03:13 +00:00
Alexander Kabaev
617e8b416d Downgrade WARNS level to more tolerable value. Attempt to fix
casts as lvalue usage whenever possible.
2004-07-28 07:19:15 +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
Oliver Eikemeier
136b0d0b52 - complete rewrite of the version number parsing code, restoring compatibiliy of 5.x with 4.x and portupgrade
- parse version numbers of ports containing an underscore followed by a number correctly

- handle special strings pl, alpha, beta, pre and rc

PR:		56961
2004-06-29 18:52:13 +00:00
Tim Kientzle
b1782cbaa9 When invoking tar, make sure the mode option (-x) is first. 2004-04-08 06:06:42 +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