Commit graph

429 commits

Author SHA1 Message Date
joerg
b770135e28 Fix a major memory leak in Dewey that existed sine ~forever.
This was made a lot more critical with the changes to use the iteration
API, as that is running a lot more Dewey comparisions.

Thanks to adrianp and wiz for the reports.

Bump to 20070916.
2007-09-16 19:03:52 +00:00
joerg
72c8bdc51b Bump to 20070911 for pkg_add -u fixes. 2007-09-11 14:55:52 +00:00
rillig
d091934e69 Replaced undefined behavior with an error message. We don't expect
absolute paths in the PLIST anyway.
2007-09-11 13:46:10 +00:00
rillig
6a27b7d10c Removed unused variable. 2007-09-11 13:39:05 +00:00
rillig
e3b68da0ff Applying sizeof() to a string parameter does not return the size of the
buffer, but the size of a pointer to a buffer. This makes pkg_add -u
work again. It failed before, trying to rename the +REQUIRED_BY file to
"/us" or "/va", depending on the value of PKGDBDIR.
2007-09-11 12:33:13 +00:00
jlam
2761568ac2 Convert to use the features framework. 2007-09-08 21:57:57 +00:00
rillig
470ab0a92f Removed the warning about pkg_add or pkg_delete "not running as root"
completely. It only made the code more bloated, and a user trying to add
or delete packages would get lots of "Permission denied" warnings
anyway.
2007-09-08 09:58:14 +00:00
rillig
775b3e4acb Avoid EPERM errors from tar when installing packages as an unprivileged
user.
2007-09-08 09:45:22 +00:00
rillig
716ddb1f45 In unprivileged builds, the user running pkg_add and pkg_delete is
almost always an unprivileged user. So there's no point in printing a
warning in that case.
2007-09-07 15:45:14 +00:00
joerg
5c78e10908 If waitpid was interrupt for some reason, restart it. Error out on all
other negative return values or when errno != EINTR.
2007-09-06 21:16:12 +00:00
jlam
ac74037944 * When adding or checking a package using pkg_admin(1), give a more
meaningful warning if the file is a symlink whose target doesn't exist.
  The message has now been changed from:

    pkg_admin: netbsd32_compat30-extras: File `/usr/pkg/emul/netbsd32/usr/lib/libm387.so' is in +CONTENTS but not on filesystem!

  to:

    pkg_admin: Symlink `/usr/pkg/emul/netbsd32/usr/lib/libm387.so' exists and is in +CONTENTS but target does not exist!

* Pass values for --sysconfdir (and --prefix) to the configure script
  instead of passing them through CPPFLAGS.  Both SYSCONFDIR and PREFIX
  are only used by audit-packages, and the audit-packages Makefile
  already handles passing these values inherited from the configure
  script.  This avoids compiler warnings that, e.g. SYSCONFDIR has been
  redefined on the command line.

* Fix quoting for arguments to the configure script -- :Q instead of
  \"\".

Bump version to 20070828.  Reviewed by <joerg>.
2007-08-29 15:42:39 +00:00
dillo
dfb18cea5b Add FILE_NAME, the name of the binary package file.
Prompted by Jeremy, okayed by Joerg.
2007-08-29 14:15:50 +00:00
joerg
9286e87ae0 Drop -RELEASE and similiar components of the OS version on FreeBSD as
well.
2007-08-24 15:25:08 +00:00
wiz
4afb1ce7a3 regen. 2007-08-23 21:58:52 +00:00
wiz
065afff669 Replace reference to (obsolete) -M with tar(1). Bump date.
Requested by joerg.
2007-08-23 21:58:24 +00:00
adrianp
92d3b5842c Fix a bug in the processing of GPG in audit-packages.conf. This should fix
PR# 36773 opened by David A. Holland.
While we're here look for settings with no values in audit-packages.conf
and ignore them.
Tighten up processing of audit-packages.conf for the situation where
settings are specified multiple times. (report from joerg@).
2007-08-22 23:23:22 +00:00
joerg
731c214320 When looking for a package with a wildcard pattern, don't add the
suffix. find_best_matching_file does that already and doing it twice
is actually counterproductive. Bump to 20070821.
2007-08-21 07:11:42 +00:00
joerg
14b81a3089 Start abstracting pkgdb access by introducing pkgdb_pkg_file.
The function returns the path name of the given file for the package.
The memory needs to be freed by the caller.
2007-08-15 02:08:40 +00:00
joerg
66657d027d Make _pkgdb_getPKGDB_DIR return const char * and fix fallout. 2007-08-15 01:49:02 +00:00
joerg
8d30fc2491 Bail out if the PLIST contains no @name field. This check existed since
the initial revision in 2002, so assume it just works...
2007-08-15 01:21:46 +00:00
joerg
ab17300d32 Split off the part dealing with already installed packages into
a subfunction.

Bail out if the package name doesn't have a version name.
Bail out if the internal rename failed (it was an assert before).
Invert some of the branches to cut off three levels of indirection.
2007-08-15 01:16:27 +00:00
joerg
6a1fd2334f Add new option -m to pkg_add. This allows to override MACHINE_ARCH
for the purpose of installing a package and enables cross-compiled
pkgsrc to not use -f all the time.

Bump version to 20070815.
2007-08-14 22:47:51 +00:00
joerg
6a86f42a52 Merge tmppkg into main variable block and remove indentation. 2007-08-13 19:15:37 +00:00
joerg
0363bc546f Check explictly for argc == 0 to find out if options where specified.
Don't depend on NULL termination of argv, count instead.
Remove more traces of slave mode.
2007-08-13 19:13:13 +00:00
joerg
8ab021fab7 pkg_admin: when retrying with a wildcard pattern, use the computed
pattern and not the base name.
pkg_info: add -E option to return the best matching installed package.

Bump to 20070813.
2007-08-12 22:09:02 +00:00
joerg
386755f3cb Restore ignorance of entry types for lsbest and lsall for now.
The check for already installed packages depends on being able
to run them in PKGDB_DIR. This is clearly obnoxius, but leave it
for later.
2007-08-12 18:54:08 +00:00
joerg
567020fab0 Reference correct variable. 2007-08-12 17:51:36 +00:00
joerg
7df87b070e - Introduce find_best_matching_file and match_local_files. This replace
the functionality offered by findmatchingname and findbestmatching
  name. They optionally strip the suffix from the filename before
  matching it, instead of modifying the pattern directly.
  Drop the old functions.
- Fix a bug in pkg_order where the version strings where inverted
- Make pkg_admin lsbest and lsall use the new functions.
- Make ftpio use pkg_order directly.

Bump version to 20070812.
2007-08-12 16:47:17 +00:00
adrianp
5bc5a2248d * Use stdout for printing results of vulnerable/eol packages found.
Reported by Greg Troxel on tech-pkg@
* Add -q which operates the same as 'pkg_info -q' and only displays
  the package name of any vulnerable/eol packages found.
  Suggestion by joerg@
* man page updates for -q
* Document the required permissions for audit-packages and
  download-vulnerability-list in the man page.
2007-08-10 22:50:46 +00:00
joerg
3c81e91396 Remove comment about importing from NetBSD. 2007-08-10 22:42:13 +00:00
gdt
52887c8e10 Reword description of rebuild-tree, and point to pkg_delete -f as a
possible cause of inconsistencies. Remove comment about make replace,
since it does not, absent pkgsrc/mk bugs, result in incorrect
dependency records.
2007-08-10 22:39:13 +00:00
gdt
2c897a092e pkg_delete In the list of options, note -ff option to remove {\bf
preserved} packages, and caution the reader that it is dangerous.
Ride hours-earlier version bump.
2007-08-10 22:29:49 +00:00
joerg
ded9371ddc Not my day. If I write "return 0 when at least one match was found",
actually return 0...
2007-08-10 21:43:58 +00:00
joerg
0fa5f07e10 Add "rebuild-tree" command to pkg_admin. It recomputes the dependencies
and builds the +REQUIRED_BY files from that.

Bump to 20070810.
2007-08-10 21:18:31 +00:00
joerg
ea7045b735 Contrary to its comments, CheckForPkg is meant to print all matching
packages (see pkg_info -e). Restore this behaviour. Still print a
warning when the pkgdb can't be processed.

Reported by Daniel Horecki and pointed to the option by tnn@.
2007-08-10 15:37:51 +00:00
wiz
00d71b8259 regen. 2007-08-10 01:12:02 +00:00
wiz
59bfde374f More indent for tagged lists; add key to FILES and add
descriptions there.
2007-08-10 01:11:05 +00:00
joerg
0009d030c3 Actually assign variable that tells the caller that we got a match. 2007-08-10 00:03:51 +00:00
joerg
a4790010d4 Make var_set and var_get arguments always use full path names. 2007-08-09 23:54:17 +00:00
joerg
14862bcfd4 Remove @option extract-in-place support for now (will be the default
later) and document @option preserve in pkg_add(1).
2007-08-09 23:32:59 +00:00
joerg
7a51a218c2 Change interface of is_automatic_installed and
mark_as_automatic_installed to take a package name and not a full path.
Add assertions to test for this.

Drop a few islinktodir checks.

Change pkg_info to use iterate_pkg_db instead of scanning the directory
by hand. As a side effect don't try to check for the pkgdb dir first,
let pkgdb_dump and iterate_pkg_db handle that.

Make pkgdb_dump return failure if it can't open the package db.
2007-08-09 23:18:30 +00:00
joerg
710504e20a Pass a number of strings around as const char *. 2007-08-09 23:06:42 +00:00
joerg
b847c0bf73 Fix segmentation fault when the package has no variables set and
no info file. Patch from Dieter Baron in pkg/36741.
Bump version to 20070809 for today's fixes.
2007-08-09 18:03:38 +00:00
joerg
9da2f994e0 Use the passed in string and Pkgdeps when calling strsep, fixing
processing of the build options. Reported by tron@ in PR 36754 and
Mark E. Perkins on pkgsrc-users.
2007-08-09 14:14:45 +00:00
joerg
5d2cdcf3b6 When matching a non-pattern (aka a base name), assign the correct
variable. This fixes pkg_info -e and in turn pkg_tarup.
2007-08-09 12:53:35 +00:00
joerg
f9b953763b Replace note_whats_installed, add_to_list_fn and generally most
users of findbestmatchingname and findmatching name with more
descriptive and easier to use iterator functions. This functions
are a first step to abstract away pkgdb layout from most parts of
the code. It also helps to reduce side effects and point out potential
bugs in this code.

Fix a potential, but practically irrelevant buffer overflow.

No longer allow symbolic links directly in pkgdb to store the meta
data of individual packages outside. E.g. /var/db/pkg/atk-1.18.0
must be a directory and not point to it. This is not yet enforced in
all parts of the code, more changes will follow.

Bump version to 20070808.
2007-08-08 22:33:38 +00:00
tnn
8629b7a0f5 Fix build on Solaris by including fcntl.h, needed for O_RDONLY definition. 2007-08-08 12:21:14 +00:00
adrianp
0f8a3686bb s//etc/${PKG_SYSCONFDIR}/ 2007-08-05 17:21:50 +00:00
joerg
a40dec8f12 Correctly handle ordering NULL -- this greatly simplifies using it
in iteration functions. Fix a major thinko that prevented the actual
order rules from being used. Bump to 20070804.
2007-08-05 14:58:49 +00:00
joerg
b5e9c6cd26 Detect grp.h. Regen. 2007-08-05 01:27:55 +00:00