Commit Graph

562 Commits

Author SHA1 Message Date
Ruslan Ermilov
07bfccd71e Mechanically kill hard sentence breaks. 2004-07-02 23:13:00 +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
9c762229f3 - pkg_create: new flag -S (clean room installation)
- pkg_create: checksum meta files too

PR:		66032
2004-06-29 18:56:59 +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
Ruslan Ermilov
362cd31336 Markup and punctuation nits. 2004-06-05 20:21:17 +00:00
Bruce A. Mah
b98176bc0b Add 4.10 and 5.2.1 entries so that pkg_add -r fetches from the right
package sets.

PR:		66251
Submitted by:	eik
2004-05-08 23:45:31 +00:00
Tim Kientzle
b1782cbaa9 When invoking tar, make sure the mode option (-x) is first. 2004-04-08 06:06:42 +00:00
Colin Percival
6a73df6f3f Synopsis fixes:
* `pkg_info -flags' needs either `-a' or a package name. [1]
 * Add -Q option to manual page.
 * Update `usage:' to match the manual page.

PR:		misc/64786 [1]
Reviewed by:	ru
MFC after:	3 days
2004-03-30 20:48:16 +00:00
Ken Smith
e77e03a08a 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)
2004-03-01 21:58:21 +00:00
Ken Smith
c15f03d381 This is an initial whitespace cleanup commit, new content to follow.
Adding hard line breaks at the end of sentences.

Approved by:	rwatson (mentor)
2004-03-01 21:50:49 +00:00
Dag-Erling Smørgrav
8afe6f9797 Instead of bogusly complaining about odd file names, handle them properly
by escaping all suspicious characters.

MFC after:	3 days
2004-01-24 17:32:43 +00:00
Dag-Erling Smørgrav
9d364741c9 Try to apply consistent indentation. 2004-01-24 15:35:04 +00:00
Ruslan Ermilov
d82881651b - Properly build both crypto and non-crypto versions of the
package management tools.

- Drop redundant dependency of pkg_create(1) and pkg_delete(1)
  on crypto libraries now that they do not link with libfetch.
2004-01-17 13:41:16 +00:00
Ruslan Ermilov
f475384e4e Replaced black magic with white magic. 2004-01-17 13:27:27 +00:00
Bruce A. Mah
2b5c94a768 Catch up with reality with respect to the location of 4.8, 4.9,
5.0, 5.1, 5.2, and CURRENT packages.
2004-01-02 00:13:20 +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
Jacques Vidrine
cd9607fdd9 Correct truncation detection after use of snprintf: The case where
exactly one character was truncated was not detected.
2003-12-17 13:36:05 +00:00
Peter Pentchev
5e5d9065e4 Clarify the order of arguments passed to the pre-/post-install script
in the description of the pkg_create -i command-line option.

PR:		55477
Submitted by:	Eric van Gyzen <vangyzen@stat.duke.edu>
MFC after:	5 weeks
2003-08-26 14:49:11 +00:00
Bosko Milekic
d8af834050 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.
2003-08-04 03:02:36 +00:00
Bosko Milekic
1d324ddef8 Use strncmp() and not strcmp() here to properly match
installed ports.

Submitted by: Harold Gutch <logix@foobar.franken.de>
2003-08-01 17:26:41 +00:00
Philippe Charnier
49f90486ce The .Xr utility 2003-06-08 14:06:45 +00:00
Mario Sergio Fujikawa Ferreira
fc12c41ca3 pkg_create incorrectly does not add trailing '\n' when it receives
either COMMENT or DESCR from the command line. When a port is
installed, one gets both +COMMENT and +DESCR files with a trailing
'\n' character. However, +COMMENT does not contain a trailing '\n'
when it is installed from a package due to this behavior of pkg_create.

 Therefore, make sure it behaves exactly the same regardless of
where got its information; either command line or files. The modified
functions are used by pkg_create.

PR:		52097
Reviewed by:	bento, kris,
		portmgr, re,
		Michael Nottebrock <michaelnottebrock@gmx.net>,
		Martin Horcicka <horcicka@FreeBSD.cz>
Approved by:	re (scottl)
MFC after:	1 week
2003-05-26 17:12:22 +00:00
Mario Sergio Fujikawa Ferreira
c32acd2e5c Add a trailing '\n' character if none is found in the information
obtained from a package. Patch show_file() [1] and show_index() [2]
functions.

PR:		52097
Reviewed by:	bento, kris,
		portmgr, re,
		Michael Nottebrock <michaelnottebrock@gmx.net>,
		Martin Horcicka <horcicka@FreeBSD.cz>
Approved by:	re (scottl)
Obtained from:	NetBSD [1],
		OpenBSD [2]
MFC after:	1 week
2003-05-26 17:06:05 +00:00
Ruslan Ermilov
db1e3a4f98 Erase whitespace at EOL.
Approved by:	re (blanket)
2003-05-22 11:56:41 +00:00
Dag-Erling Smørgrav
7691f66abf Retire the useless NOSECURE knob.
Approved by:	re (scottl)
2003-05-19 15:52:01 +00:00
Ruslan Ermilov
aba60fa66b Fixed troff(1) and mdoc(7) warnings.
Approved by:	re (blanket)
2003-05-18 21:05:22 +00:00
Kris Kennaway
7f6bf1d8ce * 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
2003-04-17 09:56:05 +00:00
Robert Watson
82c459bef8 Revert url.c:1.2: there was a race condition between when I produced
the fix and when I committed it -- in between the two, DES committed
a different fix, rendering this fix unneeded.

Requested by:	des
2003-04-17 03:51:06 +00:00
Robert Drehmel
b61ee45f0e - Print out an error message instead of dereferencing a NULL pointer
if matchinstalled() found no packages, which happens to be the
   case after fresh installations.
 - Instead of using strstr(3) to match the package name, depend on
   matchinstalled()'s MATCH_REGEX package matching.

PR:		bin/50384
MFC after:	2 weeks
2003-04-04 14:40:49 +00:00
Robert Watson
8cd5699048 Don't pass NULL in as a flags argument to libfetch's fetchGetURL()
as this can result in a NULL pointer deference when parsing the
flags later.  This change fixes "pkg_add -r" on 5.0-CURRENT for
me; not quite clear how the problem was introduced.
2003-03-27 20:44:09 +00:00
Matthew N. Dodd
a9cd061a2a - Add the 'b' option which causes BLOCKSIZE to be hornored when
the 'q' or 'Q' options are present.
- Document BLOCKSIZE.
2003-03-25 01:22:42 +00:00
Matthew N. Dodd
5e3714183f 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
2003-03-25 00:51:41 +00:00
Dag-Erling Smørgrav
0f98df2956 Fix a long-standing bug where if the package being deleted had no
post-deinstall script, the variable intended to hold the name of that
script would be used uninitialized.  In some cases, fexists() would
succeed, causing pkg_delete to try to chmod +x it, then execute it,
resulting in bizarre error messages such as:

.//: Permission denied

This bug would normally only occur when multiple packages were
specified on the command line; otherwise post_script would be located
in a previously unused part of the stack, and implicitly (but quite
accidentally) initialized to all-zeros.

MFC after:	3 days
2003-02-25 15:01:54 +00:00
Mike Heffner
b655930760 Initialize sign to NULL so that we don't attempt to free() it in case
of failure.

MFC after: 1 week
2003-02-20 20:13:07 +00:00
Bill Fumerola
6e085fd13f even the default case in a switch requires some action (add break;)
EVP_sha1() returns a const EVP_MD *, so reflect that in the variable
we store its return value in.
2003-02-03 22:47:03 +00:00
Mark Murray
edf34e80d8 No need for the OPENSSL_NO_KRB5 switch anymore.
Fixed by:	nectar
2003-01-31 23:26:55 +00:00
Mark Murray
c6dfac3ee8 iAdjust for OpenSSL 0.9.7. 2003-01-28 23:08:41 +00:00
Tom Rhodes
d13d6a9ed2 Note that -c is no longer supported. This was requested by a few users and
we even have a PR about it.

PR:		47388
Discussed with:	bmah
Requested by:	many
2003-01-27 02:05:59 +00:00
Dag-Erling Smørgrav
a5c14b885b Actually, the canonical way would be syntactically correct. 2003-01-09 12:04:21 +00:00
Dag-Erling Smørgrav
9939988ef2 Canonical way of determining whether or not to use crypto. 2003-01-09 11:57:58 +00:00
Jordan K. Hubbard
12ebd46e4b Prevent buffer overflow in format_cmd() by properly tracking maximum
buffer size.
Reported by:	Lionnel CHAPTAL <Lionnel.Chaptal@IPricot.com>
MFC after:	1 week
2003-01-06 07:39:02 +00:00
Jens Schweikhardt
9d5abbddbf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
Mike Barcroft
064c8b22be Back out rev 1.33; getbsize(3)'s original interface has been restored.
Approved by:	markm
2002-12-30 18:16:26 +00:00
Jens Schweikhardt
57bd0fc6e8 english(4) police. 2002-12-27 12:15:40 +00:00
Ruslan Ermilov
8d5d039f80 Uniformly refer to a file system as "file system".
Approved by:	re
2002-12-12 17:26:04 +00:00
Kris Kennaway
cc865772a5 Minimal change to cause pkg_version to examine the new INDEX-5 file
instead of INDEX.  This should be done better since this file name will
depend on the FreeBSD major version.
2002-12-04 17:22:48 +00:00
Bruce A. Mah
2930533d3f Assume that packages passed on stdin are in bzip2 format, not gzip.
(sysinstall depends on this feature for package addition.)

Comment on hard-coded bzip2 usage in the spirit of rev. 1.58.
2002-11-14 21:01:17 +00:00
David E. O'Brien
242bb95312 Clean up a little. Don't need to include fetch.h any more, and I can't
find any consumers of HOSTNAME_MAX.
2002-11-06 09:03:53 +00:00
David E. O'Brien
d920cd78f4 Break fileGetURL() out into its own file so that pkg_install/lib consumers
pkg_{create,delete} don't need to needlessly link with libfetch.
2002-11-06 08:57:03 +00:00
Dag-Erling Smørgrav
8758ef9b41 Whitespace cleanup 2002-10-29 12:14:31 +00:00
Andrew Gallatin
fda3659531 getbsize() now takes a pointer to a size_t as its first arg. A pointer
to an int no longer works on an LP64 platform...
2002-10-24 17:27:32 +00:00
Bruce A. Mah
b07931e581 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.)
2002-10-08 05:15:21 +00:00
Garrett Wollman
0d3bcc2e80 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
2002-09-21 01:28:41 +00:00
Bruce A. Mah
5eef315753 Update to use *.tbz suffix, also update example URL.
While I'm here, fix a gramm-o.

PR:		42576
Submitted by:	Jeff Ito <jeffi@rcn.com>
MFC after:	1 day
2002-09-10 02:42:59 +00:00
Maxim Sobolev
747b731a5f Sigh, finally activate pkgwrap.c.
Big pointy hat to:	sobomax (who apparently needs some sleep)
Submitted by:		walt <wa1ter@hotmail.com>
2002-09-09 22:59:06 +00:00
Bruce A. Mah
7b89cd2657 Fix minor off-by-one error.
Submitted by:	jhb
2002-09-09 21:21:34 +00:00
Bruce A. Mah
bc49694c45 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
2002-09-09 19:44:17 +00:00
Maxim Sobolev
92d1bb6515 Introduce notion of the package tools revision and allow to wrap all tools
included into pkg_install according to the content of /var/db/pkg_install.conf
file, which specifies version and alternative location of the tools. Format
of the said file is very simple: one line which specifies revision of the
alternative version of the tools and their location separated by space,
i.e.:

20030102 /usr/local/sbin

This would allow bsd.port.mk to install and use up to date version of tools
on older system from ports.

Also add new `-P' flag to pkg_info, which causes it to report currently
installed version of package tools.

Discussed with:	will
2002-09-09 19:43:30 +00:00
Maxim Sobolev
7f5231e4f3 Kill debugging line occasionally slipped into rev.1.3.
Submitted by:	reg
2002-09-09 11:13:00 +00:00
Maxim Sobolev
d4f82fcf34 Vastly decrease amount of memory comsumed in the case when we have to read
ports/INDEX, by allocating eactly amount of memory necessary for storing
each particular entry, insdead of 4K per entry (more than 7000 entries -
go figure). Memory consumption went down to some 500K from some 30M.
2002-09-09 08:00:32 +00:00
Maxim Sobolev
d083e1c6a4 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
2002-09-09 06:06:09 +00:00
Maxim Sobolev
76b27d2150 When installing package from a local file assume that all subsequent
autoinstalled dependencies will have the same extension, not just
".tbz".

Pointy hat to:	obrien
X-MFC after:	-1 day
2002-09-03 06:59:33 +00:00
Kris Kennaway
c1b2c47ad7 Don't treat unknown commands as fatal errors: they are probably just
the signature of out-of-date pkg_tools and newer packages.

Reviewed by:	jkh
MFC after:	3 days
2002-08-31 20:21:47 +00:00
Jeremy Lea
dd1d26511d Don't dump core on packages with an invalid or empty PLIST.
Reviewed by:	markm
2002-08-26 13:25:48 +00:00
David E. O'Brien
b9d958f5d4 Grrr.... mumble.... a linger gzip'ism still existed.
Submitted by:	Craig Rodrigues <rodrigc@attbi.com>
2002-08-26 03:44:44 +00:00
David E. O'Brien
7412ba062f Reorg just a tad to better express our bzip intentions. 2002-08-25 01:01:08 +00:00
David E. O'Brien
1ab94a83c2 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.
2002-08-25 01:00:16 +00:00
Mario Sergio Fujikawa Ferreira
cf5c89e1fe Preserve suid/gid permissions when extracting packages remotelly
fetched with -r option

Reviewed by:	will
Approved by:	will
2002-08-24 20:04:17 +00:00
Maxim Sobolev
f46eb8f0b8 Ensure that origin field in the packing list structure is initialised. This
fixes problem when there are origin-less packages installed on a system

Reported by:	Mark Knight <markk@knigma.org>
MFC after:	3 days
2002-08-12 16:15:25 +00:00
Jens Schweikhardt
2b239dd118 Fix typos; each file has at least one s/seperat/separat/
(I skipped those in contrib/, gnu/ and crypto/)
While I was at it, fixed a lot more found by ispell that I
could identify with certainty to be errors. All of these
were in comments or text, not in actual code.

Suggested by:	bde
MFC after:	3 days
2002-08-11 13:05:30 +00:00
Akinori MUSHA
9988e3662f Another .tbz2 -> .tbz leftover. Properly look for pkgname.tbz.
MFC after:	1 day
2002-08-04 21:27:57 +00:00
Akinori MUSHA
752b4d681e 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
2002-08-04 21:20:09 +00:00
David E. O'Brien
9e0e832f14 Use an 8.3 friendly extension when compressing with bzip2. 2002-08-04 06:03:34 +00:00
Maxim Sobolev
64449e2a32 When extracting package pass `-p' option to tar(1), so that files are
extracted with correct permissions.
2002-08-02 17:26:53 +00:00
Mark Murray
8360b6af14 C replacement for the Perl5 code.
Submitted by:	reg
2002-06-24 16:03:24 +00:00
Dag-Erling Smørgrav
937ce6a950 Reorder libraries to fix static linking (libssl depends on libcrypto, so
it must come before libcrypto in LDADD)

Reviewed by:	bde
2002-06-12 12:45:24 +00:00
Ruslan Ermilov
4093807dd9 libfetch now depends on libcrypto and libssl. 2002-06-06 13:45:46 +00:00
David E. O'Brien
b47f7d2f16 Grammar nit.
Submitted by:	keramida
2002-06-04 20:01:53 +00:00
Bruce A. Mah
ca8f81dd24 pkg_version was incorrectly claiming that 1.5 == 1.5.0.1, because
we weren't properly checking for the case that the two version strings
being compared had different numbers of components.  This has been
fixed.

Pointed out by:	sobomax
Reviewed by:	silence on -ports
2002-05-31 15:45:48 +00:00
Ruslan Ermilov
24caa840be mdoc(7) police: markup nits. 2002-05-30 08:24:52 +00:00
Maxim Sobolev
027d0ad454 MFS: two more testcases highlighting recently discovered problem with version
comparison routine.
2002-05-28 18:00:44 +00:00
Maxim Sobolev
6950a26a50 Eliminate free'ing already freed chunks.
MFC after:	1 week
2002-05-22 10:33:25 +00:00
Maxim Sobolev
62553a3cbf MFS: silence compiler warnings. 2002-05-20 09:55:41 +00:00
Eric Melville
595d77f913 Remove cross reference to pkg_update(1).
Submitted by:	dd
2002-05-16 22:46:53 +00:00
Tom Rhodes
67c8020f12 Consistancy check: s/file system/filesystem/g 2002-05-16 02:28:39 +00:00
Maxim Sobolev
dd3a3dfc3b - 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
2002-05-14 21:42:37 +00:00
Ruslan Ermilov
423e9124d9 Mark all internal libraries with INTERNALLIB. 2002-05-13 11:24:03 +00:00
Eric Melville
003f849311 Remove cross reference to pkg_update(1). 2002-05-11 16:27:19 +00:00
Alfred Perlstein
f7bb25f702 replace __FUNCTION__ with standardized __func__.
Requested by: jhb
2002-05-11 04:17:55 +00:00
Alfred Perlstein
a2bcd1a09f fix build:
you may not use string concatination with __FUNCTION__, replace all occurances
of:
__FUNCTION__ ": error string"
with:
"%s: error string"
2002-05-11 03:48:49 +00:00
Maxim Sobolev
8ae0995264 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
2002-05-10 00:03:14 +00:00
Paul Richards
ee13ade8a0 Do my bit for the Perl removal team and shoot my own, rather mangy
looking, dog.
2002-05-08 18:44:24 +00:00
Maxim Sobolev
a1ad4f468a 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
2002-05-05 21:03:25 +00:00
Maxim Sobolev
f351f851db 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
2002-05-05 20:50:27 +00:00
Maxim Sobolev
ae346c242b Update usage() and manpage to match reality (add -O into usage and adjust
both to make clear that -W and -O are stand-alone options).

MFC after:	6 days
2002-05-05 13:44:32 +00:00
Maxim Sobolev
2dc0025a87 Use PLIST_ORIGIN instead of rolling own version using PLIST_COMMENT.
MFC after:	6 days
2002-05-05 13:09:04 +00:00
Maxim Sobolev
63d4f9853d Handle PLIST_ORIGIN properly.
Poked by:		kris
Pointy hat grabbed by:	sobomax
MFC after:	6 days
2002-05-05 12:54:11 +00:00
Maxim Sobolev
76c0ee0ef2 Add ability to query installed packages based on origin. 2002-05-04 14:49:49 +00:00