Commit graph

833 commits

Author SHA1 Message Date
joerg
a44d636e1d pkg_install-20090817:
Add a new command for pkg_admin: findbest. It takes one or more patterns
and searches for the best match in PKG_PATH, just like pkg_add would.
It prints the URLs of the best match for each pattern to stdout.

Rewrite the config file parser to read the file only once.
2009-08-16 21:10:14 +00:00
joerg
ae84d2dc25 Fix a bug in pkg_add's -P handling. For dependencies the pkgdb path was
computed incorrectly and included destdir more than once.

Fix the ACTIVE_FTP option to actually set the "a" flag and not the old
"p" flag.
2009-08-16 14:26:46 +00:00
wiz
dc4ee19bc7 regen. 2009-08-06 18:16:57 +00:00
wiz
f562b816f7 Bump date for CHECK_LICENSE. 2009-08-06 18:16:33 +00:00
wiz
c4f91c4a43 regen. 2009-08-06 18:15:41 +00:00
wiz
42ac050037 Bump date for -k. 2009-08-06 18:15:27 +00:00
wiz
24a8ca8027 regen. 2009-08-06 18:14:48 +00:00
wiz
531a02fc44 Bump date for previous. 2009-08-06 18:14:15 +00:00
joerg
1feca87cdb pkg_install-20090806:
- pkg_add: add support to check license conditions before installation
- pkg_delete: add -k option to skip over preserve packages.
2009-08-06 16:53:34 +00:00
joerg
3587185961 pkg_install-20090727:
Make pkg_install WARNS=4 clean and fix a number of lint warnings.
Based on reports from veego about warnings with older GCC releases in
pkg_delete, where a variable is potentially used uninitialized.
2009-08-02 17:56:44 +00:00
wiz
dcc7e8e6e1 Add mpl-1.0 (Mozilla Public License), and allow it by default.
(We already had version 1.1 in pkgsrc, this is needed for at least ptlib.)
2009-07-26 09:18:29 +00:00
joerg
e322a401bc pkg_install-20070724:
- license handling: accept upper case letters. Keep license checks
  case-sensitive as done in the older pkgsrc logic. Document this.
  OK dillo@, schmonz@, wiz@
- pkg_info:
  - fix handling of non-packages, that are valid archives
  - invert order of pkg_info -r to better match the expectations of
    make update.
2009-07-24 19:06:45 +00:00
tron
76437887cd Add "mpl-1.1" and "zpl" to the license which are accepted by default. 2009-07-15 10:24:13 +00:00
joerg
71d359d9d3 Never run the license check for this package to allow a proper update
path.
2009-06-14 15:08:45 +00:00
joerg
413e163ddb pkg_install-20090610:
Improve diagnostic around license handling.
2009-06-10 20:15:11 +00:00
joerg
0f6bbfec73 Fix typo. 2009-06-03 20:03:40 +00:00
ahoka
8f598fa767 Add miros to the default accepted licenses. 2009-06-03 16:45:17 +00:00
joerg
1435cf330d pkg_install-20090528:
I can't remember why the original pkg_install-renovation code disabled
extraction of ownership from packages, so reenable that.
2009-05-28 08:59:59 +00:00
joerg
bf2cff01f3 Sync license list with mk/license.mk. 2009-05-27 21:56:11 +00:00
joerg
c4f4275600 pkg_install-20090527:
Try harder to mimic the old pkg_delete behavior and provide a
topologically sorted output for pkg_info -r. Bail out on dependency
cycles based on recursion depth, currently 64K.
2009-05-27 20:26:03 +00:00
wiz
60f460ab01 Use standard location for LICENSE line (in MAINTAINER/HOMEPAGE/COMMENT
block). Uncomment some commented out LICENSE lines while here.
2009-05-19 08:59:00 +00:00
wiz
12239df3b8 Sync default-accepted licenses with pkgsrc/mk/licenses.mk.
Bump version to 20090518.
2009-05-18 10:01:37 +00:00
wiz
9f06c66cbd regen. 2009-05-13 10:52:56 +00:00
wiz
6975c2b3fb usage: match man page more closely. 2009-05-13 10:51:46 +00:00
wiz
a13f8b378f Sort options in SYNOPSIS. 2009-05-13 10:51:33 +00:00
joerg
5b3521a978 Regen. 2009-05-13 03:35:36 +00:00
joerg
6156ed74c0 pkg_install-20090513:
Add pkg_create -F, which explicitly provides the compression type.
2009-05-13 03:33:50 +00:00
joerg
ac97e66040 G/C PlayPen and PlayPenSize. 2009-05-13 03:18:05 +00:00
joerg
34ca7f8f1b Fix spelling. 2009-05-10 21:11:43 +00:00
reed
93688a0e21 Add new metadata: PREV_PKGPATH and SUPERSEDES.
These will be available from pkg_summary(5) database.
To be used to find previous packages when a package is moved
or renamed. (Even though that is not recommended.)

Documented in pkgsrc Guide and in the pkg_summary(5) manual page.

Upcoming commit will have some packages modified to add them.
2009-05-02 16:14:37 +00:00
joerg
2f64176828 Regen. 2009-04-25 21:32:45 +00:00
joerg
28926842fa pkg_install-20090425:
Add logic to evaluate license conditions. As frontend for pkgsrc,
pkg_admin gets two new commands (check-license and
check-single-license), which can be used to evaluate a given condition.
pkg_add will be changed to honour licenses at a later point.
2009-04-25 21:31:13 +00:00
joerg
5baf67d213 Regen. 2009-04-24 14:13:06 +00:00
joerg
dbe6fb0a8c pkg_install-20090424:
Make pkg_delete -d the default behavior, remove the option.
Remove pkg_create -R support (reorder @dirrm entries).
Introduce new plist command @pkgdir, which makes pkg_add add
this directory if it doesn't exist already and pkg_delete remove it
only if no other package has a @pkgdir entry for it. Otherwise
directories are pruned when the last file or directory in them is
removed. @dirrm is now a pure hint, if the directory doesn't exist, it
will be silently skipped.
2009-04-24 14:00:25 +00:00
joerg
76d122cd42 Constify. 2009-04-24 01:03:41 +00:00
joerg
3a4f443ed9 If the plist doesn't have a @name tag in it, fake one up based on the
directory name.
2009-04-23 22:13:00 +00:00
joerg
ee93491f09 Require all plist commands to be in lower case. Nothing depends on that
and it was never documented that it worked either way, so being strict
doesn't hurt.
2009-04-23 19:53:52 +00:00
joerg
3748569021 Remove support to spell of @cwd as @cd. 2009-04-23 19:38:14 +00:00
joerg
6dc281ec17 Remove remaining parts of @mtree support. 2009-04-23 19:35:52 +00:00
joerg
7216c47ead Remove support and documentation for @ignore_inst. 2009-04-23 19:34:04 +00:00
joerg
4d7ee3338c pkg_install-20090422:
Consider EOF during signature scan a fatal error. At the very least, the
package is missing the +CONTENTS file at that point. Correctly reset the
entry pointer in that case and make the meta data extraction stricter,
avoiding NULL dereferences for invalid archives.
Fixes pkg_info -X crash on empty files as reported by Daniel Horecki.
2009-04-22 19:18:06 +00:00
joerg
9ee86af3f2 Regen. 2009-04-22 19:14:16 +00:00
joerg
831ff9838f Document pkg_admin fetch-pkg-vulnerabilities -u. 2009-04-22 19:13:54 +00:00
reed
00b6b96445 Remove mention to install security/audit-packages (which no longer
exists) and suggest audit capabilities of pkg_admin instead.
Update version.
Regeneration of cat page also caught up with some previous cleanups.
2009-04-10 04:03:11 +00:00
joerg
368d71b62e Remove redundant NO_CHECKSUM and EXTRACT_ONLY definitions. 2009-04-09 00:48:06 +00:00
joerg
d0076c3403 Remove the remaining NO_MTREE definitions, it has been a nop for a
while.
2009-04-08 22:43:23 +00:00
joerg
3238d0ace2 pkg_install-20090406:
Remove premature return that broke dependency tracking for pkg_add -u.
Fixes PR 41143.
2009-04-06 14:34:15 +00:00
joerg
2218854d15 Remove trailing \n in warnx call. Pointed out by seb@ 2009-03-30 19:26:39 +00:00
joerg
375837bf0b pkg_install-20090326:
Fix diagnostic message to be less confusing to read.
2009-03-26 14:32:39 +00:00
joerg
0e28d608e9 Improve markup. 2009-03-22 23:42:35 +00:00
tnn
b2e981665d pkg_delete: add missing setprogname(argv[0]); 2009-03-21 16:43:50 +00:00
joerg
91e5d9ff5a Specify width for tag list. 2009-03-10 20:33:43 +00:00
joerg
8de13e20ef Use archive_read_finish and avoid double-free if the archive couldn't be
opened.
2009-03-09 20:01:22 +00:00
joerg
4b68a2dafa pkg_install-20090309:
Fix a double free. Reported by seb.
2009-03-09 19:58:45 +00:00
joerg
fcc1963a3e If writing to the archive failed, tell user the file it tried to write. 2009-03-08 17:26:23 +00:00
joerg
b02e7e47c4 pkg_install-20090307:
Simplify archive handling by depending on archive_read_finish and the
close callback where needed. Fixes a file descriptor leak as side
effect as reported by wiz.
2009-03-08 14:50:36 +00:00
joerg
2901543f5b Avoid sign comparision issues. 2009-03-06 15:18:42 +00:00
joerg
fbb7f3e773 Explicitly build local libarchive without ACL support, I don't want to
get into the mess of needing to figure out linkage on Linux.
2009-03-04 19:47:20 +00:00
joerg
9eb91efbb3 pkg_install-20090302:
Add new option -r to pkg_info, which works like -R, but expands it
recursively.
2009-03-02 17:13:49 +00:00
joerg
35f74daf9a Remove a close(-1) as hinted by wiz. 2009-03-02 15:30:45 +00:00
joerg
9b9d6a3ce9 Be nice to stupid version of TAILQ_INSERT_TAIL on Linux, that doesn't
create a block context.
2009-03-02 15:15:06 +00:00
joerg
af07339813 pkg_install-20090301:
Plug a number of file descriptor leaks.
2009-03-02 14:59:14 +00:00
wiz
1bb6451a10 regen 2009-02-28 16:25:46 +00:00
wiz
1f3593dd09 Fix typo. 2009-02-28 16:20:50 +00:00
wiz
f629212fdd Remove trailing whitespace. 2009-02-28 16:19:17 +00:00
joerg
5bdcb8f520 pkg_install-20090228:
Integrate the PKG_PATH logic for tightly with the find_archive logic:
- remember initial current working directory from the time PKG_PATH is
  processed, it will be used as reference for all relative entries
- remove now redundant fchdir dance in pkg_add
- pass down to find_archive if this is a top-level package (e.g.
  requested on the command line) or not; the location of top-level
  packages is searched for packages first and for URLs or path names the
  PKG_PATH itself is not processed (e.g. pkg_add foo/bar not look into
  PKG_PATH for bar). This addresses PR 33884 in a different way.
- document the rules for finding packages more explicitly
- allow specifying PKG_PATH in pkg_install.conf as well; environment
  takes precendence.
- remove PKG_PATH related logic in pkg_info(1), it doesn't deal with
  PKG_PATH anyway
- remove PKG_PATH, PKG_TMPDIR and TMPDIR description in pkg_info(1),
  they are no longer used
2009-02-28 16:03:56 +00:00
joerg
f9a9823e92 When checking for explicit conflicts, skip the old version checkif no
old version exists (e.g. because this is not an update).
Reported by Thomas Klausner.
2009-02-27 19:34:12 +00:00
joerg
816c3045cd pkg_install-20090226:
Always try to preserve the +PRESERVE file from the old package, even
when the new one has one as well. This fixes the update case for the
special case of pkg_install itself as reported by tron@.
2009-02-26 12:52:43 +00:00
joerg
afe5fbacdd Be silent if querying a variable and no installed information exists.
"pkg_info -Q automatic foo" should not bitch.
2009-02-25 20:52:10 +00:00
wiz
e6bba895cc Bump date for previous. Remove trailing whitespace. 2009-02-25 16:57:51 +00:00
joerg
7fc8fb8212 pkg_install-20090225:
Rewrite pkg_delete to expand the list of packages to delete first and
reorder it if necessary. It will bail out if it knows in advance that it
can't remove a package. It will also fail for errors while removing one
package, unless forced. Add an option to remove automatically installed
packages that are no longer used.

The pkgviews support is kept, but untested. The error handling for
pkgviews most of all is as weak as before.

Basic review from hubertf@, man page changes by bad@.
2009-02-25 16:29:08 +00:00
joerg
2939cc9d49 Fix markup. From Tim Zingelman. 2009-02-25 15:19:00 +00:00
joerg
f0209f8ffe Make sure that SYSCONFDIR is expanded in pkg_install.conf(5). 2009-02-19 20:27:36 +00:00
joerg
fa27df019a Improve support for ancient OpenSSL releases. 2009-02-16 20:59:11 +00:00
joerg
3fe7d4b4fb Point to the various commands of pkg_admin that replace audit-packages,
not just fetch-pkg-vulnerabilities. Suggested by David Holland.
2009-02-15 18:20:32 +00:00
joerg
d64aadd1db Tag as pkg_install-20090214 in preparation for updating NetBSD current. 2009-02-14 17:08:05 +00:00
obache
55b26be751 Need to define SSL_SUPPORT before using it :) 2009-02-14 03:02:58 +00:00
joerg
09b6362c0a Explicitly pull in crypto if building with ssl option. 2009-02-13 14:13:58 +00:00
joerg
03c3a41d9e Explicitly check that the conflicting package is not the one we want to
remove for update; mysql-client has a pattern that matching itself.
Reported by Obata Akio.
2009-02-13 13:19:12 +00:00
joerg
e0011104f7 Non-matching signature file name is not an hard error, so return 1. 2009-02-13 13:17:41 +00:00
joerg
d5294c7411 Close the archive on fatal errors during signature validation. This can
happen e.g. if pkg_add finds a directory with that name.
Remove a bunch of HAVE_SSL conditionals that no longer apply as GPG
support is back in.
2009-02-13 11:21:07 +00:00
joerg
643788189c pkg_install-20090213:
Fix pkg_delete -d:
- ignore @dirrm commands, directories are removed already on demand
- use local copy of dir before changing it, the caller expects it
unmodified for the call to pkgdb_remove
2009-02-13 01:31:42 +00:00
joerg
d66a067120 Fix setting of PKG_METADATA_DIR. 2009-02-12 22:23:06 +00:00
joerg
601eb83a16 Don't check for tgetent or curses, it is never used. 2009-02-12 00:14:48 +00:00
joerg
f6da77786c Don't segfault if running pkg_info on a binary package without
+BUILD_INFO (or installed without +INSTALLED_INFO). Second half of
PR 30276.
2009-02-11 23:51:30 +00:00
joerg
52e03c25de pkg_install-20090212:
Print the error about missing build information even when the
+BUILD_INFO file is missing instead of segfaulting. The problem is from
PR 30276, a solution in the form of just installing it will not be
implemented.
2009-02-11 23:42:42 +00:00
joerg
a5ef458265 Fix !OpenSSL build/bootstrap. 2009-02-09 16:54:08 +00:00
wiz
677c83584c regen. 2009-02-08 23:14:14 +00:00
wiz
9db60ccb61 Spelling fixes. 2009-02-08 23:12:10 +00:00
wiz
5db37a19b0 Use more markup. 2009-02-08 23:12:05 +00:00
wiz
200c1b97c9 New sentence, new line. 2009-02-08 23:11:56 +00:00
joerg
60289b484d pkg_install-20090205:
- Restrict audit related commands to the documented set and/or fix the
  documention.
- Add support for conditional fetch-pkg-vulnerabilities via -u option.
2009-02-05 17:22:19 +00:00
joerg
0ffd57fde6 Don't chdir back to the original directory at the end of make_dist,
pkg_create is about to exit() anyway.
2009-02-05 16:06:55 +00:00
joerg
d33d3af1f8 Include fcntl.h. 2009-02-03 19:47:37 +00:00
joerg
97f4088f5d Remove the remaining trails of HAVE_DBLIB. 2009-02-03 13:49:56 +00:00
joerg
4835ef2879 Fix PR 40456: Mac OS X can't deal well with BSS in static libraries. 2009-02-03 13:44:34 +00:00
joerg
2b915dcf8f If no db.h or variant exists, use the one from nbcompat.
For PR 40544.
2009-02-03 13:18:03 +00:00
joerg
c5349bbb20 Include fcntl.h for O_RDONLY, it is included indirectly on NetBSD, but
not on Solaris. Part of PR 40544.
2009-02-03 13:15:34 +00:00
joerg
42be515354 Merge x509 setup and documentation from pkg_install-renovation. 2009-02-02 12:49:16 +00:00
joerg
d7cc6db11b Merge pkg_install-20090201 from pkg_install-renovation branch.
- DB support is always included from libnbcompat if needed
- pkg_view and linkfarm are not installed any more; they are not moved
into the attic yet, so they can easily be installed as separte package
- common configuration file to customise the behavior of various
components; this supersedes the old audit-packages.conf
- support for PKSC7 signatures (using X509 certs) and GPG signatures for
packages in a secure way. See pkg_admin(8) for how to create them and
pkg_install.conf(5) for the options to use them
- audit-packages and download-vulnerability-list are wrapper scripts
  around pkg_admin. They try to mimic the classic options if used sanely.
  "pkg_admin audit" is now an order of magnitude faster than before
- pkg_add uses libarchive and libfetch instead of external ftp and tar:
  - progress bar is currently missing for downloads
  - "pkg_add -" is no longer supported
  - no adhoc check for conficts between dependencies and already
    installed packages
  - "pkg_add -s" has been replaced with an option in pkg_install.conf,
    verification of plain detached GPG signatures is no longer supported
  - optional check for vulnerabilities before adding a package
  - if /var and /usr/pkg are on different fileystems it is twice as fast
    now
  - conflicts due to overlapping plists are checked before installation
  - pkg_add no longer plays with the process limits
- pkg_add and pkg_delete have a new destdir option; scripts have to
  either be modified to use PKG_DESTDIR or should be disabled
- pkg_add -u for now can't be used to update to the exact same version
- internal "rm -rf" and "mkdir_p" code
- all memory allocation failures are not explicitly fatal
- if a file is not removed due to a failed checksum, still remove the
  entry from pkgdb
2009-02-02 12:34:59 +00:00
rillig
f772ef6398 An int is not guaranteed to be 64bit and in fact isn't on most
platforms.
2008-12-14 10:18:16 +00:00
adrianp
40abbe86e4 +audit-packages
+download-vulnerability-list
2008-12-10 22:02:18 +00:00
erh
c8629a84a6 Fix strip_txz() so it actually works even when the extension found isn't
going to be returned.  This fixes some issues with automatic installation
 of dependencies.
2008-10-13 15:54:24 +00:00
joerg
1e2d474b2b pkg_install-20081002:
Explicitly cast time_t values to long and print them as such.
Reported by bjs@.
2008-10-02 20:46:56 +00:00
joerg
1a04e21a8b pkg_install-20080916:
Merge from changes for read_plist from pkg_install-renovation to always
initialize the plist and add append_plist for the one case where this is
not desired. Fixes PR 39276.
2008-09-17 15:21:30 +00:00
joerg
76d159ee1e 20080915:
Merge a number of bugfixes from the pkg_install-renovation branch:
- explicit include of nbcompat/md5.h
- use errx when dealing with libfetch as it doesn't set errno
- avoid optind = 0 as GNUish getopt will reset itself otherwise
2008-09-16 13:32:58 +00:00
joerg
489db20e86 Update libarchive and bsdtar to 2.5.5.
This further polishes bsdcpio and brings in a number of portability
fixes.

Revert temporary hack to not use vfork on IRIX.
2008-07-14 14:56:50 +00:00
joerg
5664f05a84 Add a temporary workaround for missing vfork on IRIX.
Fixes PR 38674, tested by tnn@.
2008-07-13 14:25:04 +00:00
joerg
9c974a83ae Don't use the existance of pkg_add as trigger to override
PKG_ADD and friends, but that the build passed the barrier.
Posted to tech-pkg@ without negative feedback.
2008-06-22 22:08:05 +00:00
joerg
da712f263e Add a marker for bootstrap packages to allow special cases them during
bulk builds.
2008-06-19 18:36:51 +00:00
he
a8e2184877 Commit two fixes which at least for me appear to be required when
doing an old-style bulk build on 4.0 or older systems:

 - in mk/bulk/build, do "make update" instead of "make install + clean"
   when installing a new pkg_install
 - in pkgtools/pkg_install/Makefile, don't try to use our own
   executables (${WORKDIR}/pkg_add/pkg_add etc.) if they don't exist

Discussed with joerg, and even though he's not entirely happy
with the latter change, he didn't appear to have a better suggestion.

This, and putting /usr/pkg/sbin earlier than /usr/sbin in the $PATH
appears to be required to get an old-style bulk build going.
2008-06-08 21:04:30 +00:00
joerg
8c227e35ef Explicitly depend on ftp. 2008-06-02 16:40:25 +00:00
wiz
fda1d9652f 2-clause my license. 2008-05-08 15:30:17 +00:00
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