Commit Graph

159 Commits

Author SHA1 Message Date
agc 2d3a1701d3 Avoid hardcoding /usr/bin/ftp in the pkg_add binary.
Fixes provided by Stoned Elipot <seb@script.jussieu.fr> in PR 17323
2002-06-21 14:49:40 +00:00
yamt 80a776becb constify and make WARNS=2 clean. 2002-06-10 09:14:26 +00:00
yamt 56268cdf57 constify. 2002-06-09 14:14:49 +00:00
yamt 51111fe65d - make last arg of findmatchingname void*.
- move some duplicated functions into lib/.
2002-06-09 13:23:44 +00:00
yamt cc8d347c9a - free memory allocated by findbestmatchingname.
- use static buffer instead of "malloc and don't free"
  for dirname_of.
- fix indent.
2002-06-09 11:56:59 +00:00
yamt 830edd8ed3 rewrite strip_txz:
- don't match against filenames like "a.tgz.a"
- more buffer overrun checks.
2002-06-09 10:40:47 +00:00
yamt f2a19ed936 - fix buffer size checks
- define PKG_PATTEN_MAX and PKG_SUFFIX_MAX and
  use them instead of constants like 255.
- add asserts and buffer size checks.
2002-06-09 03:50:13 +00:00
yamt ae85a7c2df - constify.
- avoid unneeded strcpy.
- add more error checks. (avoid segv
2002-06-09 03:38:59 +00:00
agc 9dd6d667fa Only define DEF_LOG_DIR if it's not already set. 2002-05-10 13:17:57 +00:00
hubertf 19f6d0bbcb Add more error checking, and tell the user what's up when he runs
into descriptor-shortage. Can be caused when installing deeply-nested
binary pkgs like kde.
2002-04-23 10:14:59 +00:00
agc 5e5f49ecfa Check the return code from the second invocation of installprereq(), to
make sure that a failed installation of a rpe-requisite package kills
the attempt to add the package. This reverts pkg_add(1) to traditional
behaviour.

Bump version number accordingly.
2002-04-02 15:08:33 +00:00
agc 2e8bd5562d When adding packages via pkg_add(1), and a pre-requisite package needs
to be added, first try to use the exact version of the pre-requisite
with which the base package was built (from the @blddep directive in
the +CONTENTS file), and then use the traditional dependency from the
@pkgdep directive.

Also rename a variable from "code" to "errc" to make it obvious what
the variable counts.

Bump version number to 20020306.
2002-03-06 17:45:20 +00:00
agc 33ef3d651a Add a new packing list directive, @blddep, which notes the exact
version of the pre-requisite package which was used to build the
package. This is derived automatically from the list of pre-requisite
packages which is provided to pkg_create(1) in the -P argument.

Bump the version number to 20020305.

Versions of the pkg_install tools prior to 20020305, when adding a
binary package with embedded @blddep directives, will warn that the
directive is not recognised, but will continue to add the binary
package.
2002-03-05 13:01:19 +00:00
agc 1c88ee495f ... and get the right month this time. 2002-02-22 10:13:41 +00:00
agc a1cbed9f66 Bump version date to reflect this change to create/pl.c:
> revision 1.22
> date: 2002/02/18 00:57:54;  author: hubertf;  state: Exp;  lines: +10 -3
> make @cwd work a bit more reliable:
>
> When -L is used (as it is by pkgsrc), don't override the directory
> set by @cwd unconditionally with what was given to -L (srcdir).
> Instead, use the @cwd directory.
2002-02-22 10:10:38 +00:00
yamt 9b2987d371 tets -> test 2002-02-02 15:30:18 +00:00
agc b85b4de6a6 Bump version number to reflect the pkg_info version number recognition
changes.
2002-01-09 18:50:17 +00:00
agc 2afa28bf02 Pull in a much simplified version of the vtest functionality. This new
functionality adds recognition of '_' and "pl" as pseudonyms for '.',
so that 1.2p2 == 1.2.2, and adds recognition of "pl" and "rc" strings,
which stand for "patchlevel" and "release candidate" respectively.

In addition, this version should handle alphabetic characters properly
(so that 1.2e == 1.2.5)

Normal NetBSD revision number processing has been retained (and is always
compared after all other tests have been performed).

64-bit integers are used internally for each component of the version
number.
2002-01-09 16:17:08 +00:00
hubertf 75b2df2eee don't hardcode "tar"'s program name, use TAR_FULLPATHNAME instead 2001-12-30 04:46:21 +00:00
tv 8e6f7afb5b MKfoo=no -> NOfoo 2001-12-12 01:48:43 +00:00
yamt d75115bcb0 fix typo that prevents to select best version of package. 2001-10-04 05:32:50 +00:00
hubertf 384aae98cc use full pathname of tar consistentlc
Patch provided in PR 14072 by Stoned Elipot <seb@script.jussieu.fr>
2001-09-26 13:48:27 +00:00
wiz 4c99916337 va_{start,end} audit:
Make sure that each va_start has one and only one matching va_end,
especially in error cases.
If the va_list is used multiple times, do multiple va_starts/va_ends.
If a function gets va_list as argument, don't let it use va_end (since
it's the callers responsibility).

Improved by comments from enami and christos -- thanks!

Heimdal/krb4/KAME changes already fed back, rest to follow.

Inspired by, but not not based on, OpenBSD.
2001-09-24 13:22:25 +00:00
wiz 456dff6cb8 Spell 'occurred' with two 'r's. 2001-09-16 16:34:23 +00:00
wiz 64662a0528 Fix `pkg_add -u' for packages without dependencies.
Patch by Hubert Feyrer.
Addresses pkg/13536.
2001-07-24 14:45:16 +00:00
hubertf 861dbe4370 Interface change for strip_txz(): now stores suffix 2001-07-15 00:34:14 +00:00
wiz 3f9984fc90 `existent', not `existant' 2001-06-19 13:42:07 +00:00
agc bd6e892efe Apply the -I substitution logic for @cd as well as @cwd (just for
completeness, as @cwd will be used almost everywhere, and @cd is
deprecated).
2001-05-21 12:06:30 +00:00
agc 95a52b2709 Add -I argument to pkg_create so that the real prefix can be specified
for the @src and @cwd PLIST directives.

Bump version number.
2001-05-21 09:17:28 +00:00
agc 6ccfedb598 Add -U argument to pkg_create - by default, all files are added to the
pkgdb.byfile.db database. If -U is specified on command line to
pkg_create, don't add the PLIST entry to pkgdb.byfile.db.

Bump version number.
2001-05-18 13:21:38 +00:00
hubertf 01b66ea788 * add function strip_txz() to strip off any .tgz, .tbz, .t[bg]z from a
given filename.
 * Use strip_txz() inside the FTP-wildcard-depends handling code to
   prevent it handing a combination of glob and dewey pattern to pmatch(),
   which our pattern matching code currently does not handle. Bugfix!

XXX The other places that could be changed to use strip_txz() are not
    touched in this commit to keep the impact of this change small in the
    light of the approaching 1.5.1 release. I'll revisit them.
2001-04-28 20:55:33 +00:00
hubertf 152216c60d on pkgdb_remove, don't retain old errors - clear errno before.
This prevents some warnings from being printed over and over again
after one error was found.
2001-04-17 10:33:35 +00:00
itojun 3e4d36b9a4 do not terminate on EINTR. with previous behavior pkg_add terminates
if we suspend/change window size.
2001-04-09 08:13:37 +00:00
wiz 14dbdf5518 Negative exit code cleanup: Replace exit(-x) with exit(x).
As seen on tech-userlevel.
2001-04-06 11:13:45 +00:00
hubertf 648fa44a28 Add -u switch to pkg_add to do a very rudimentare form of pkg upgrading:
When invoked with 'pkg_add -u ...', and the package to be installed is
found already being installed, the old (installed) package is removed
with pkg_delete, and the new one is installed.

A very crude handling of dependencies is done (by moving the +REQUIRED_BY
file aside before pkg_delete, and back into place after the new pkg is
installed).

This needs a lot more work to TRT, but it's a first start.
2001-03-18 03:20:28 +00:00
wiz a456915f39 Bump version to 20010307 (yesterday's bugfix, and a 1.4 build fix). 2001-03-07 10:04:33 +00:00
wiz 2bf9002908 This header file needs no __RCSID. 2001-03-07 09:44:40 +00:00
wiz e0fc1c5416 Fix typos in comments 2001-03-06 10:29:11 +00:00
wiz 45678a8082 version.o depends on version.h. 2001-03-05 18:24:58 +00:00
wiz 429d019073 Don't allow NULL version packages to match. Patch by hubertf.
Bump version to 20010306.
2001-03-05 18:12:49 +00:00
wiz 2ba98ef9a1 Add -V option to all pkgtools, which reports the version of the pkgtools.
Document it. While there, fix the ordering of the option descriptions in
some man pages. Set version to 20010305.
2001-03-05 16:53:12 +00:00
wiz fcf23e4f53 Using strcmp with NULL pointers is a bad idea. Fixes pkg/11647. 2001-03-05 16:48:35 +00:00
wiz 6c81e9b559 Fix command line for tar in the case that the file to be handled doesn't
end in 'z' or 'Z'.
2001-03-05 16:46:23 +00:00
lukem c2aa46e7c2 use %ll_ instead of the less standard %q_ 2001-01-05 03:27:26 +00:00
hubertf 6e6337b43d * findmatchingname():
When the bzip-pkg handling was introduced, a dewey pattern (foo>1) may get
   a character-class-pattern attached (.t[bg]z), and the code was not prepared
   to match that. I've special-cased handling of character-class pkg suffixes
   for ".t[bg]z", and when scanning a dir in findmatchingname() now both the
   'first' part of the pattern (e.g. "foo>1") and the suffix (e.g. ".t[bg]z")
   must match the file, hence the two pmatch() calls.

 * findbestmatchingname_fn():
   Caught a case where ".t[bg]z" was not properly handled. Must do the same
   suffix-processing again here!

Fixes PR 11856 by Dan McMahill <mcmahill@mit.edu>
2001-01-01 22:07:35 +00:00
hubertf 3d76df0ee0 Strip not only .tgz but also .tbz etc. (missed from last commit) 2000-12-13 03:49:56 +00:00
hubertf 5382dffae7 * Accept ".tbz" as an alternative pkg suffix to ".tbz" for pkg_add and
pkg_info
 * In pkg_create, compress with bzip2 if a .tbz suffix is given
 * Fix pkg_info to work via ftp, either via URL specified on command line
   or via one made up from PKG_PATH (if set)

XXX ALWAYS tacks on ".t[bg]z", NOT ".t[gb]z" !!!
2000-12-13 03:17:53 +00:00
hubertf fc8a285aa2 Fix timeout in expect():
The FTP coprocess formerly wrote the output of the "get | tar vxf -" pipe
to stderr, which resulted in no output to the feedback pipe (stdout), and
thus the timeout was not updated for any line printed by the "tar" process.
This was now changed to also feed back the chars to the expect() routine,
updating the timeout handler. The "also" part is implemented by passing
the output through "tee /dev/stderr".

At least NetBSD and Solaris have this, so no problem there.

Thanks to Frank van der Linden for helping me to debug this.
2000-11-28 01:16:01 +00:00
hubertf ec58d85250 Don't mkdir("/usr/tmp") in a desperate try to get some space.
If it's there, use it. If it's not there - bad luck.

Pointed out by Simon Burge <simonb@wasabisystems.com>.
2000-11-26 03:12:01 +00:00
hubertf efeb1d1e82 Don't swallow '%' in file/directory names.
Patch submitted in PR 11352 by Brook Milligan <brook@biology.nmsu.edu>
2000-10-31 23:47:05 +00:00