Commit graph

670 commits

Author SHA1 Message Date
martin
d86d72404e Drop clauses 3 and 4 from TNF licenses 2008-04-29 05:46:08 +00:00
joerg
451f0436c4 Revert last change, it was not intended to go into HEAD. 2008-04-26 17:40:01 +00:00
joerg
ba8b7d3861 Add a clean pkg_add implementation on top of libarchive and libfetch.
Known regressions:
- "pkg_add -" (aka reading from stdin) is currently not supported
- "pkg_add -s" is not supported either
- no progress reports for the downloads
- binary packages with hardlinks created by pkg_create before
  pkg_install-20080422 will not extract correctly (libarchive issue)
- no adhoc check for potential conflicts between dependencies and
  already installed packages

Features:
- Twice as fast for the typical case of /var/tmp and /usr/pkg on
  different filesystems
- Standalone
- implicit conflict detection before actual installation.
2008-04-26 14:56:33 +00:00
joerg
4d3a05f90f Make pkg_delete with -p actually work. Prepending the prefix doesn't
work as it will still use the one in the package. Use the approach from
pkg_add to override it instead.
2008-04-23 20:54:39 +00:00
joerg
e40da5bac1 pkg_install-20080423:
Make the linkresolver code more robust.
2008-04-23 16:58:07 +00:00
joerg
279f4d312b Requires libarchive 2.5. 2008-04-23 14:37:10 +00:00
joerg
24f6331375 Restore symlinks as the code was accidently removed. 2008-04-22 14:27:51 +00:00
joerg
6bb49fafea pkg_install-20080422:
Make use of the linkresolver from libarchive and thereby fix the
permissions of hardlinks in archives.  This wasn't a problem so far
as nbpax is (incorrectly) ignoring the permissions of the other entries.
2008-04-22 13:47:08 +00:00
joerg
76e68316b6 Detect socket and gethostbyname requirements for Solaris. 2008-04-20 13:59:09 +00:00
joerg
8e530a6d06 Move get_dash_string to pkg_create as only user.
Remove str_lowercase.
2008-04-18 17:16:44 +00:00
joerg
262da955cc Nuke unused macros. 2008-04-18 12:01:46 +00:00
joerg
d82752f969 pkg_install-20080415:
Add audit-history subcommand for pkg_admin, that lists all known
vulnerabilities for a given base package name. E.g. if you run a web
server, don't run "pkg_admin audit-history php" before going to bed.
2008-04-16 00:53:06 +00:00
joerg
7ae2547c43 Refactor by moving logic for IGNORE_URL into subfunction. 2008-04-15 22:24:38 +00:00
joerg
7e5d22b940 Force depend target to explicitly run for libfetch. Disallow parallel
builds in that part of the build. This works around issues with
bootstrap-mk-files not handling DPSRCS correctly.
2008-04-08 11:50:46 +00:00
joerg
dee7a26d93 Simplify logic and make pkgdbdir the default for
pkg_vulnerabilities_dir.
2008-04-07 13:25:32 +00:00
joerg
0f52644262 pkg_install-20080407:
Add command to print effective value of configuration variables.
Remove FETCH_CMD variable from pkg_admin, it is not used.
2008-04-07 13:07:14 +00:00
joerg
18d8ba7ebd Don't build pkg_io.c during bootstrap. 2008-04-06 17:47:27 +00:00
joerg
0d4cca2484 Fix audit -t argument -- it should actually take the option. 2008-04-04 21:45:33 +00:00
tnn
f923a1ef51 -lfetch to make it build. PR pkg/38365. 2008-04-04 20:46:59 +00:00
joerg
5990cd6523 Also switch pkg_admin's fetch-vulnerabilities implementation to
libfetch.
2008-04-04 15:47:01 +00:00
joerg
3cb9e8532d pkg_install-20080404:
Switch pkg_info to use libfetch for remote access.
2008-04-04 15:21:32 +00:00
jlam
a8d98ad4bf Override PKG_INFO_CMD to point to the just-built pkg_info so that
pkg_install can install using newer features without warnings.
2008-04-03 14:22:26 +00:00
jlam
dca8b98cde Invoke the correct pkg_admin command during post-installation. 2008-04-02 13:23:31 +00:00
tron
93f9a70abf Use a workaround to prevent a linker error on Mac OS X Leopard.
Reviewed by Joerg Sonnenberger and approved by Dieter Baron.
2008-03-31 16:52:13 +00:00
dsainty
0eec92f6dd Correct typo in usage message: vulneraiblities -> vulnerabilities 2008-03-23 01:04:47 +00:00
joerg
42c387859a Request getopt with optreset support from libnbcompat. 2008-03-21 23:28:33 +00:00
joerg
ae389f8ee9 Revert last change. The symbol is already defined in
lib/vulnerabilities-file.c and making it a common symbol just hides the
real issue (whatever it is).
2008-03-21 14:47:53 +00:00
jklos
2ae724aeb2 Fixes pkg/38250 and makes pkgsrc work on Darwin again. Thanks to
Christian Neukirchen.
2008-03-21 08:18:17 +00:00
joerg
c5e343fa4e If this is not a native NetBSD build, use the libnbcompat version of
unistd.h.
2008-03-20 20:26:52 +00:00
joerg
06751e9460 Explicitly include fcntl.h for Solaris. From PR 38240. 2008-03-19 15:33:12 +00:00
joerg
67bb1dc761 Fix bootstrap build. From Stoned Elipot. 2008-03-15 10:55:34 +00:00
joerg
47338958a0 Needs unistd.h. 2008-03-15 10:46:08 +00:00
joerg
89cfa8c5c4 pkg_install-20080313:
Audit functionality for pkg_admin. This uses the backend in
libpkg_install and will be extended to check for vulnerabilities at
pkg_add time later.
2008-03-13 16:35:30 +00:00
wiz
6a268616e6 Fix download-vulnerability-list's -c option. From Jim Bernard in PR 38231. 2008-03-13 08:37:43 +00:00
joerg
2274b33c19 pkg_install-20080311:
If the package db directory doesn't exist, handle it like an empty
pkgdb and just return.
2008-03-11 18:01:35 +00:00
wiz
c663245bff Add datarootdir to shut up configure. 2008-03-10 12:14:32 +00:00
wiz
07a4f5d2e6 Remove pprefix (accident?). Add datarootdir to shut up configure. 2008-03-10 12:13:55 +00:00
joerg
f473241bc3 Don't print errno for missing GPG setting. 2008-03-09 22:26:56 +00:00
joerg
c0e008f2f1 Stop chdir/getcwd/fchdir dance in lsall and lsbest, just use the passed
in path name. This is more consistent when symbolic links are involved
as it doesn't do the equivalent of realpath(3) for the path any longer.
2008-03-09 20:55:25 +00:00
joerg
849d11cabb pkgdb.byfile.db maintainance can use the iterator interface as well.
Get rid of more chdir() calls.
2008-03-09 20:36:22 +00:00
joerg
a56a864b83 Use pkgdb function to compute +CONTENTS name and drop need to play
chdir(2) games. Kill the chdir(2) calls.
2008-03-09 19:25:16 +00:00
joerg
4aec8613d2 Split check functions into a separate file.
Drop checkall and implement it using "*" as wildcard match.
2008-03-09 19:02:27 +00:00
joerg
543123b86f pkg_install-20080309:
- When loading meta data for a package and a file is needed for the
  current operation and is a required file, complain.
- Include the name of the package the meta data could not be loaded
  from.

This addresses PR 38166.
2008-03-09 18:03:46 +00:00
rillig
fcf2370845 Why does pkg_add need many open file descriptors? 2008-03-01 19:06:10 +00:00
joerg
60733a045e Use pkg_add from new build, override *_CMD instead of the full commands.
Drop some no longer used overrides.
2008-02-26 13:38:57 +00:00
joerg
1db5e140f8 pkg_install-20080223:
Redo the check for incomplete packages by annotating which meta data
field are required and count which were found during reading the binary
package. The original approach didn't work as loads from pkgdb are
reduced to the minimal set.
2008-02-22 21:58:16 +00:00
joerg
512767273a pkg_install-20080222:
Free libarchive's side of the package before closing the file descriptor.
This stops leaking up to 1MB / package when using bzip2 and addresses
PR 38082. Check that at least +COMMENTS, +CONTENTS and +DESC can be
extracted, otherwise skip the entry. This stops pkg_info -X from dumping
core on non-package files.
2008-02-22 15:53:52 +00:00
joerg
7f98245283 pkg_install-20080219:
Add new parser for pkg_vulnerabilities, that handles decompress
transparently and internally. Preliminary tests with a modified
audit-packages show a speed increase by 2 for common operations
like listening all vulnerable installed packages.
2008-02-19 15:16:24 +00:00
joerg
1960164c7e Always use the newly built pkg_create -- this makes updates easier. 2008-02-09 14:08:05 +00:00
joerg
e6206e80d6 Having to wonder for 5min why pkg_add would fail just to discover that
it couldn't exec the shell scripts due to mount -o noexec, make the
error message a bit more verbose.
2008-02-08 00:58:17 +00:00
joerg
e08e39667b pkg_install-20080208:
Explicitly check in show_var that the buffer is non-NULL.
This can stops pkg_info -Q foo from segfaulting for explicitly
installed packages. Reported by Stoned Elipot.
2008-02-07 23:40:52 +00:00
joerg
4f81810ae0 Include fcntl.h for Solaris. From Andri Piik in private mail. 2008-02-05 18:57:09 +00:00
joerg
9866d214df pen.c only uses statvfs.h and the necessary headers are included by
libnbcompat.h already. So don't include sys/param.h and sys/mount.h in
it and remove the configure test for sys/mount.h.
While here, remove some #if 0'd code from pen.c.
2008-02-04 14:28:27 +00:00
joerg
8ada92d5fc pkg_install-20080204:
Try to remove all +* files from the pkgdb first. If the log directory is
not empty afterwards, be noisy, but try rm -rf on it for the force case.
2008-02-04 14:03:10 +00:00
joerg
7bdc02c45c pkg_install-20080202:
Convert pkg_info to use libarchive instead of tar for binary package
handling. As a side effect pkg_info on remote packages will use
one FTP instance per argument, but will try to fetch only the meta data.
This reduces time for pkg_info -X on a full binary repository from 36.9s
to 18.1s for the cache hot case (PKG_TMPDIR on tmpfs for the old
pkg_info). Thanks to tnn@ for testing.
2008-02-02 16:21:45 +00:00
joerg
ed48acb8ad Explicitly check that meta data files are regular. 2008-02-02 15:47:52 +00:00
hubertf
5c695ce274 Sign over my copyright to TNF. 2008-01-29 15:39:30 +00:00
joerg
258724b565 pkg_install-20080126: Make pkg_add pass down -I and -m when recursively
adding packages.
2008-01-26 23:30:24 +00:00
rillig
95ce0db1bf When updating a package, the "(perhaps the packing list is incorrectly
specified?)" warning isn't correct, so don't print this assumption at
all.
2008-01-26 09:23:31 +00:00
rillig
2ef4aec279 Fixed typos. 2008-01-13 22:31:25 +00:00
adrianp
44c6e6e2dd Add 'audit-packages -F <file>' to process a list of packages/patterns
from a file.
Update and sort options in the man page
2008-01-07 22:27:59 +00:00
rillig
5299226d71 If a command line argument is used, it should be mentioned by exactly
this name (pkg-name) and not some related description, to make searching
easy.
2008-01-04 14:24:38 +00:00
rillig
eeebd3ec03 When calling open(2), don't try to get an error message from libarchive,
since it won't know anything about it. (hi joerg!)
2008-01-03 22:31:20 +00:00
joerg
a0e4ad1e20 Prepare for update of NetBSD and pkgsrc-2007Q4 by tagging current state
as 20071224. Changes include:
- better diagnostic for conflicting packages
- explicitly check already installed packages for conflicts with
to-be-installed package
- document pkg_admin rebuild-tree in usage
- man page fixes
- forcefully remove pkgdb entries (needed for user-usage in some cases)
2007-12-23 23:58:27 +00:00
rillig
545e51df61 The +CONTENTS file is checked for conflicts, not +REQUIRED_BY. 2007-12-19 02:22:54 +00:00
rillig
5a54dec7a9 Documented struct package_conflict and added a note about the
inefficiency when reading all the +REQUIRED_BY files.
2007-12-17 09:42:03 +00:00
tnn
0d152f7013 document 'rebuild-tree' in usage() 2007-12-10 10:34:42 +00:00
rillig
872ab1f25d style 2007-11-30 00:39:39 +00:00
rillig
bae1429f34 Do not install a package if some of the installed packages would
conflict with it. This fixes PR 37451.
2007-11-30 00:30:39 +00:00
rillig
bb376f4684 Remove the package metadata even if it is read-only, without prompting
the user.
2007-11-29 22:50:05 +00:00
wiz
ccf4f0a7e4 Add two missing .Ek. 2007-11-14 22:57:07 +00:00
rillig
485e264ceb Provide more useful details in the error message for conflicting packages:
- The package that cannot be installed
- The pattern of the conflict
- The name of the installed (conflicting) package.
2007-11-13 19:53:11 +00:00
martti
9afb20a137 Added commented-out LICENSE=something. 2007-11-11 11:35:48 +00:00
joerg
b97a055750 Don't use the build time version to find packages, we want to pick up
the newest version. Bump version to 20071109.
2007-11-08 23:24:56 +00:00
joerg
e725e20c42 Bump version or revision of all packages that have a runtime dependency
on gzip.
2007-11-08 19:39:42 +00:00
joerg
91812f0d5f Also add -E to usage(). From PR 37265. 2007-11-05 09:39:38 +00:00
joerg
6a334feaf4 pkg_install does the right things with the files, so CHECK_PERMS is not
useful and creates cyclic dependencies if pkg_install is outdated.
From Peter Bex.
2007-11-03 14:49:00 +00:00
joerg
e7633a92f1 Tag pkg_install as 20071103. 2007-11-03 13:54:14 +00:00
joerg
e47f81c12a Remove obsolete option r from usage() and man page. I can't even
remember what is was for. From Yakovetsky Vlad in PR 37265.
2007-11-02 16:03:37 +00:00
rillig
5ea2c37615 Added quotes around the filenames, as suggested by joerg@.
While here, removed an unnecessary variable.
2007-11-01 23:08:29 +00:00
rillig
23369be14a When rename(2) fails, it is useful to know some details about the
filenames that have been involved.

Do not use assert() for error checking.
2007-11-01 21:57:37 +00:00
rillig
9d0009f173 Fixed the problem with package name matching that Klaus Heinz discovered
in http://mail-index.netbsd.org/tech-pkg/2007/10/14/0004.html

The pattern "pkg_install" matched "pkg-install-20070828", but "pkg*all"
didn't. Now it does.
2007-10-14 23:24:24 +00:00
rillig
095814e759 Updated the URLs for ftp.NetBSD.org, so that they will work after the
upcoming clean-up.
2007-10-13 19:38:27 +00:00
martti
bd986edbc7 Remove trailing spaces. 2007-10-09 19:19:08 +00:00
kano
abdb54b351 fix obsolete URLs for www.NetBSD.org
close PR pkg/37071
reviewd by xtraeme@
2007-10-07 12:59:11 +00:00
rillig
b59af9beee There is no master/slave mode anymore. 2007-09-29 13:24:32 +00:00
joerg
dfcb17cf7f - Be less aggressive when resizing the version field, just resize if
the old size is not enough. Fixes PR 37031.
- Disable dependency tracking in libarchive build. Supposed to address
  PR 36953.

Bump version to 20070927.
2007-09-27 13:30:27 +00:00
joerg
79ba801833 Don't cache the allocated argv in a local static variable, just allocate
and free it.
2007-09-18 15:44:18 +00:00
joerg
5046845687 Remove EXPECT_DEBUG code and if(0)'ed call of setbuf. 2007-09-18 15:40:47 +00:00
joerg
7177f144cd Make allocation errors fatal. Better than leaking memory in the error
case.
2007-09-18 15:38:10 +00:00
adrianp
7c6a237bbe Add and document FETCH_PRE_ARGS, idea from David Sainty in PR #23899.
This allows such settings as the following in audit-packages.conf:
FETCH_PRE_ARGS="env ftp_proxy://ftp.myproxy.com"
Which will be set before FETCH_CMD is run.
2007-09-17 22:40:27 +00:00
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
joerg
f24ae1bb8a Try hard to get 64bit offsets in all modules, fixing misunderstandings
between libarchive and pkg_create e.g. on HP-UX.

Add my copyright to build.c, it is almost completely rewritten.
2007-08-04 12:32:01 +00:00
joerg
73ba3ef5c6 Fix bootstrap issues reported by tnn@ 2007-08-03 15:44:18 +00:00
joerg
46e6de189b The forced disabling of zlib and bzip2 was meant for testing only,
remove it. *blink*
2007-08-03 15:12:43 +00:00
joerg
fb85dba2b4 Bump date for last change. 2007-08-03 13:55:29 +00:00
joerg
199aa00ff5 - only build pkg_admin, pkg_create and pkg_info for --enable-bootstrap
- for pkg_create, split-off the package creation from the plist
  processing. package creation is disabled for --enable-bootstrap
- change package creation to use libarchive
- add two options (-u and -g) to override file system ownership
- pkg_create now creates files in the tarball with correct owner/group
  based on -u/-g or @owner/@group
- add a function to compute the +CONTENTS file in memory

Bump version to 20070802.
Review of a slightly older version by jlam@
2007-08-03 13:15:58 +00:00
wiz
440dab353e regen. 2007-08-02 23:34:08 +00:00
wiz
e22d5fa05f Bump date for fixed paths. 2007-08-02 23:34:00 +00:00
wiz
f9b0a454db Update some paths on ftp.NetBSD.org.
Addresses PR 36721.
2007-08-02 23:30:20 +00:00
taca
42ca54029b Include <stdint.h> if HAVE_STDINT_H is defined, not HAVE_INTTYPES_H.
Fix build problem on SunOS 5.8.
2007-08-01 23:58:15 +00:00
joerg
f1cd925f5b -Wall is a non-standard flag, don't use it in a bootstrap package.
Bombed out on by xlC.
2007-07-31 13:32:04 +00:00
joerg
c54865f2f5 Remove a now unused extern declaration. 2007-07-30 10:33:07 +00:00
joerg
ee5d571224 Remove first obstactle in pkg_add for switching to libarchive:
MASTER/SLAVE mode is gone now.

Bump version to 20070730.
2007-07-30 08:09:14 +00:00
joerg
d3a02b798c Don't build a list for a single item, but change the pkg_perform
interface to hand it down directly.
2007-07-30 07:25:10 +00:00
joerg
ba250884a3 Push pkg_perform prototype into the individual packages. 2007-07-30 07:16:21 +00:00
seb
e40571f70c Specify PKG_DBDIR to pkg_admin and pkg_info via their -K argument
instead of environment. This allows mk/flavor/pkg/resolve-dependencies
to execute '${PKG_ADMIN}': you can encounter this problem
on platforms in need of pkgtools/pkg_install because their native
pkg_* tools are older than PKGTOOLS_REQD, id est NetBSD 2.x and earlier.

Ok'ed joerg@.
2007-07-29 17:39:31 +00:00
adrianp
5ca9237032 Remove redundant SUBST_* from package Makefile
OK'ed joerg@
2007-07-29 14:06:44 +00:00
joerg
17c965dcc3 After the obsoletion on March, remove the support for require scripts.
Also remove the documentation of the mtree parts as it is not supported.
2007-07-26 11:30:55 +00:00
joerg
43de2f8a8b As discussed in PR 36662, the include of nbcompat.h takes care of
the need to include sys/cdefs.h. Do include err.h if it exists
or we are not building for pkgsrc, otherwise use nbcompat/err.h.
2007-07-26 11:27:58 +00:00
joerg
64c41eca87 Mostly deorbit mtree support:
- pkg_create bails out with -m
- pkg_add ignores mtree specs in packages and prints a warning.
  It does not remove the file like before.
- remove now obsolete documentation.

pkg_info still prints the information and pkg_admin ignores the files.
Make the dependency on the tools a runtime dependency.
Take maintainership of pkg_install and bump version to 20070725.
2007-07-25 15:01:45 +00:00
adrianp
2637bfc26b Check we can write to ${PKGVULNDIR} before attempting a download.
Reported by wiz@
2007-07-24 18:57:02 +00:00
adrianp
ae1629c33a Include nbcompat.h to sort out err.h
Add a conditional include for cdefs.h
This resolves the remainder of the issues in PR #36662
Thanks to Stuart Shelton for testing and feedback.
2007-07-23 12:29:32 +00:00
tnn
954b179cfd Move variable declaration to top of function body to make this build with
older versions of gcc. From Anonymous on IRC.
2007-07-22 13:22:21 +00:00
adrianp
39b2b8ef53 Add missed file in last update 2007-07-21 10:21:38 +00:00
adrianp
74d71ced16 Misc man page fixes
Update to autoconf 2.61
Add checks for AC_TYPE_UINT{8,16,32,64}_T
Add checks for stdint.h
Change how config file notification works
If no IGNORE_URLS directive is found then just say that
Check that pkg-vulnerabilities exists before we try any operations on it
Use st_ctime as opposed to st_ctimespec.tv_sec as the former is SUSv3
This update should fix PR #36655 and go part way to fixing PR #36662

Thanks to tnn@ and joerg@ for suggested fixes and Yakovetsky Vladimir and
 Stuart Shelton for testing and patches.
2007-07-21 10:21:04 +00:00
joerg
5fc8c04e5a Split pattern related functions from lib/str.c off into lib/opattern.c.
Rename pmatch to pkg_match and add new function pkg_order that
implements the order logic used by pkg_add internally.

Change the interface of findmatchingname's callback to take the pattern
used for the matching as first argument. The new pkg_order function
takes it and it doesn't hurt in other cases. Adjust callers and
corresponding callbacks accordingly.

Remove an unused matchfn typedef in dewey.c.

Bump to 20070720. OK jlam@
2007-07-20 22:22:52 +00:00
wiz
fdfa17436f New sentence, new line. Sort options. 2007-07-18 23:33:19 +00:00
joerg
1e9a4230a4 Change download-vulnerability-list.sh to use exec_prefix in the
sense of pkg_tools_prefix and prefix in the sense of LOCALBASE.
This allows individual overriding for NetBSD.

Add the forgotten part to allow DESTDIR builds and the pkgsrc.7 man
page.
2007-07-16 13:23:02 +00:00
joerg
bc4117d57f Retire helper scripts for merge from src, this is now the authoritive
version.
2007-07-16 11:40:10 +00:00
joerg
9df3e415c9 Merge remaining small changes from NetBSD, most of all the pkgsrc.7 man
page. Fix build on !NetBSD. Rebuild man pages with nroff -mandoc on
NetBSD current for consistency. Make it DESTDIR safe. Remove the note
that src/usr.sbin/pkg_install is the authoritive version, it won't be
any longer.
2007-07-16 09:57:56 +00:00
joerg
289ba68704 Merge r1.37 from NetBSD:
PR/36274: Jukka Salmi: pkg_add(8) -t option broken, template passed in
is treated as a directory. While there simplify and shorten the code...
2007-07-16 09:54:55 +00:00
joerg
ca03bfb945 Merge 1.75 of lib/ftpio.c from NetBSD:
When fixing vsftpd, other FTP server were broken as they return
different error codes for unmatching glob patterns. Basically ignore the
error code and just try the other pattern. chdir errors are still
considered fatal.

Bump version to 20070715.
2007-07-14 22:57:15 +00:00
adrianp
8f09fd52a9 Bump pkg_install 2007-07-14 20:19:48 +00:00
adrianp
16b215dd7e Update to pkg_install-20070714
Merge of audit-packages with various improvements:
* Version 20070714
	Initial release of re-write in C
	Add support for notfication of eol packages (-e)
	Multiple levels of verbosity (e.g. -v -v)
	Specify a custom config file to use (-c)
	Query running config values (-Q)
	Default to download .gz compress pkg-vulnerabilities file
	Support for .bz2 compress pkg-vulnerabilities file
	Verify signature on downloaded files (-s)

Thanks to tron@, jschauma@, agc@, joerg@ and pkgsrc-security@ for feedback
and testing.
2007-07-14 20:17:06 +00:00
joerg
eb66d11868 Remove PKG_TOOLS_PREFIX handling for mtree, pax, pkg_install and
tnftp. Modifying files and possibly removing them from the base system
is doing more harm than use. Bump revision or version of each
package.
2007-07-10 15:19:17 +00:00
wiz
c7bc2fe5bf Sync with pkgsrc (1.46). 2007-05-19 14:42:10 +00:00
joerg
bbe0e4e1ae Sync with src: PRIu64 -> MY_PRIu64 + fallback value of PRIu64. 2007-04-20 14:25:13 +00:00
tnn
18f57f251c re-add fix from r1.11 after sync 2007-04-20 13:48:16 +00:00
tnn
f844d8b5e3 re-add fix from r1.42 after sync 2007-04-20 13:36:25 +00:00
joerg
52ba06bdee Sync with NetBSD base:
Some FTP server don't expand [] in NLIST, most noticable is vsftpd.
Avoid this by splitting the wildcard search pattern into two commands.
Sync some other minor changes.

Bump to 20070416.
2007-04-16 12:55:34 +00:00
joerg
1b6ca55b58 Sync config.{guess,sub} with mk/gnu-configure. 2007-03-12 00:48:28 +00:00
joerg
77305c28ef Sync with NetBSD base version:
- obsolete support for require scripts
- nuke support for the following options of pkg_create:
  -X (excludefile)
  -r (require script)
  -h (Force follow symlink)
- add option for pkg_create to specify additional @blddep packages.

This brings us to version 20070308.
2007-03-11 22:05:03 +00:00
wiz
1c7c116e8b Sync with src. 2007-02-07 06:49:22 +00:00
reed
087c665604 Update pkg_summary(5) man page to mention how it can
be generated (from NetBSD).
Add a PKGREVISION.
2007-02-06 01:30:11 +00:00
joerg
611e7f92de Merge add/extract.c, rev 1.39:
If a plist contains @owner or @group entries and first rename failed,
  pushout was called with NULL argument. This has the semantic of using a
  working directory of "/", even though already read plist entries are
  relative to prefix. The calls to chown and chgrp therefore end up with
  the wrong arguments for the current directory. To compensate for this,
  don't pushout the first time. As plists are not supposed to have
  multiple @cwd entries anymore, this could most likely be simplified, but
  that is outside the scope of this commit.

Merge lib/plist.c, rev 1.51:
  When processing symlinks in pkg_delete and the call to readlink failed,
  it often helps to know why, so use warn instead of warnx.

Bump version to 20061103.
2006-11-03 09:35:14 +00:00
schwarz
53de6e942a make sure INSTALL gets passed to the Makefile 2006-08-19 14:38:52 +00:00
gson
9d4c7f77de Import the following change to add/perform.c from src to pkgsrc:
Fix uninitialized variable which was causing pkg_add -u to randomly
 dump core.  This may fix PR pkg/30292.

Also bump the pkgsrc PKGTOOLS_VERSION to 20060720.
2006-07-20 11:29:48 +00:00
jlam
808fe7ac5f USE_DIGEST is no more. 2006-07-18 23:06:41 +00:00
rillig
c47985fa7d Merged from src:
> In header files, there shall be no variable definitions, only
> declarations. Found by MIPSpro.
2006-07-11 07:45:40 +00:00
dillo
7a046011cb Pull across from source:
Fix pkg_info -Q on binary packages; noted by rillig.
Bump version to 20060701.

Okayed during freeze by wiz.
2006-07-01 19:37:25 +00:00
hubertf
448b30d04d Update usage() - sync with manpage, add missing options, etc. 2006-06-27 23:36:13 +00:00
jlam
5f9a3a1b99 This package overrides the "update" target (is that wise?) and runs
its own set of commands.  One of these invoked "deinstall" with
UPDATE_RUNNING set to "YES"; however, UPDATE_RUNNING was made into a
pkgsrc private variable a little while ago.  Fix "update" by setting
_UPDATE_RUNNING instead.  This fixes PR pkg/33716.
2006-06-13 13:57:10 +00:00
jlam
2cc3f64abb Add a new variable CHECK_FILES_SUPPORTED which is a package-settable
variable to show whether the package supports running the check-files
target.

Set CHECK_FILES_SUPPORTED to "no" in pkgtools/pkg_install in the case
where the PREFIX does not match ${LOCALBASE} it's likely the tools are
being installed in some place that's completely outside pkgsrc control,
and check-files fails horribly in that case.
2006-06-09 16:12:08 +00:00
jlam
65b866d2f4 Make pkg_install build on platforms that don't define the PRIu64 integer
format modifier.  We include "defs.h" in the files that use PRIu64 as
that is the header that contains stand-in definition.
2006-05-10 04:25:30 +00:00
dillo
ffd2c03b44 Sync with src: HOMEPAGE is optinal, noted by wiz.
Regen catman page.
2006-04-25 13:33:18 +00:00
wiz
cc17cf1e8e Sync with usr.sbin/pkg_install/lib/pkg_summary.5 v1.2: Sort. 2006-04-24 22:05:13 +00:00
dillo
10da79a1a1 Sync with src, version 20060424:
Add support for creating summary file containing all information
	about a package repository needed by package managing software.
	This allows better use of remote binary package repositories.

	Discussed on tech-pkg.
2006-04-24 13:52:04 +00:00
hubertf
8f17059838 Sync with NetBSD's src/usr.sbin/pkg_install Version 20060418,
mostly for the timeout fix in ftpio.c.
2006-04-18 20:41:44 +00:00
wiz
9ee6553610 Sync with src/usr.sbin v1.63:
Formatting nits.
2006-04-08 23:06:21 +00:00
reed
295b6a402f Welcome to version 20060405.
pkg_add also check for USE_ABI_DEPENDS.

Check if USE_ABI_DEPENDS or IGNORE_RECOMMENDED was set
when this package was built. IGNORE_RECOMMENDED is now historical.

For the cat man page, I manually made it say "pkgsrc" instead of
"NetBSD".

I committed to NetBSD's src/usr.sbin/pkg_install/ first :)
2006-04-06 06:49:30 +00:00