Up to [cvs.NetBSD.org] / pkgsrc / pkgtools / pkg_install / files / lib
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
pkg_install-20201218 - Support continuing to install to /var/db/pkg if it exists and the new pkgdb doesn't. In the future, we can warn about this once we have tested advice that we can give to users who want to move the location of pkgdb. - Don't do anything about /var/db/pkg on non-NetBSD-base. This creates conflicts with other package managers that also install to /var/db/pkg.
pkg_install: update to 20201205 Improve warning about old database to mention moving the refcount db too.
*: move default database directory from /var/db/pkg to ${PREFIX}/pkgdb
As discussed in August 2020 and previously on pkgsrcCon 2019.
Ok pkgsrc-pmc@
pkg_install-20100421: Fix an off-by-one in the check for properly sized pkgdb entries. It rejected perfectly valid entries.
pkg_install-20100405: - Try to detect common forms of pkgdb corruption and issue a warning in that case. - Refactor the pkg_vulnerabilities logic to use the compression support from libarchive. This reduces the amount zlib/bzip2 interaction to the linkage.
pkg_install-20100122:
- Refactor man pages:
- Move description of environmental variables into pkg_install.conf(5)
- Remove a bunch of dead references
- Avoid using hard-coded path names that can easily be overridden by
the user.
- Refactor pkgdb related logic, so that -K behaves consistently.
- Add some helper functions to isolate more places from the pkgdb
layout.
- Sync license list.
- Handle PKG_REFCOUNT_DBDIR consistently as option too.
- Utilize connection cache from libfetch.
- Add helper target for cat pages updates.
Pullup ticket #2921 - requested by joerg pkg_install: bug fix Revisions pulled up: - pkgtools/pkg_install/files/lib/pkgdb.c 1.36 - pkgtools/pkg_install/files/lib/version.h 1.142 --- Module Name: pkgsrc Committed By: joerg Date: Thu Oct 22 22:51:29 UTC 2009 Modified Files: pkgsrc/pkgtools/pkg_install/files/lib: pkgdb.c version.h Log Message: pkg_install-20091009: Do not overwrite a string with itself using snprintf. This breaks setting the pkgdb directory internally on Linux. Explicitly check if the string is the same and otherwise just use xstrdup.
pkg_install-20091022: Do not overwrite a string with itself using snprintf. This breaks setting the pkgdb directory internally on Linux. Explicitly check if the string is the same and otherwise just use xstrdup.
pkg_install-20090911: - Cleanup configure.ac to not check for headers and functions not used - Always use nbcompat/db.h on !NetBSD (PR 41865) - Don't bother setting termwidth in pkg_info, it is never used.
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.
Remove the remaining trails of HAVE_DBLIB.
If no db.h or variant exists, use the one from nbcompat. For PR 40544.
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
pkg_install-20090201: - sync DESCR and MESSAGE with HEAD and the branch state - sync Makefile - regen configure - cleanup __RCSID - merge audit logic in pkg_add and pkg_admin into new audit_packages function. As side effect, pkg_add will list all vulnerabilities before asking the user whether it should continue - sort config_variable array
Most memory allocation failures were fatal already and the majority of the rest lacked an explicit check. Add the usual x* wrappers around malloc and friends that explicitly terminate on error and use them in all but Dewey.
Merge license changes from the HEAD.
Drop clauses 3 and 4 from TNF licenses
Sign over my copyright to TNF.
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.
Make _pkgdb_getPKGDB_DIR return const char * and fix fallout.
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.
Handle newer versions of Berkeley DB. Our algorithm is: - if you have > db1 the probably you have db_185.h which means that dbopen is really __db185_open, and we'll prefer that. - else if you have db1, then you have db1/db.h and dbopen - else if you have db.h, then this is either the one from db1 and it will work with -ldb having dbopen, or it will not. Note that the compatibility option on __db185_open() will actually not create or update db1.85/1.86 files, but it will use the current format of the db library. This compatibility layer is source code only.
Pull in documentation improvements and a minor change to allow building with WARNS=2 from src/usr.sbin/pkg_install. No functional change and no version bump.
Update pkgtools/pkg_install to 20050204 (latest release from the HEAD
branch of src). Changes from version 20050106:
Teach pkg_add(1) and pkg_delete(1) to pass PKG_METADATA_DIR and
PKG_REFCOUNT_DBDIR in the environment when running the +* scripts.
PKG_METADATA_DIR is the location of the +* files after the package is
registered. PKG_REFCOUNT_DBDIR is the location of the reference counts
database directory. If PKG_REFCOUNT_DBDIR is left unset, then it
defaults the the location of the package database directory with
".refcount" appended to the path, e.g. /var/db/pkg.refcount.
pkgviews users should explicitly set PKG_REFCOUNT_DBDIR in the shell
environment to ensure that all packages will use the same refcount
database.
These changes allow the +INSTALL and +DEINSTALL script to keep state
in +* files within ${PKG_METADATA_DIR}, and to store reference counts
in ${PKG_REFCOUNT_DBDIR} to handle usage of resources outside of
${LOCALBASE}.
Pull in portability changes from src, and bump version to 20041226: Introduce a new abstraction in the C code, called MaxPathSize. All previous occurrences of MAXPATHLEN and FILENAME_MAX have been changed to use MaxPathSize instead. If MAXPATHLEN is not defined, then assume a default value of 1024 (this is primarily for use on the Hurd). The reason for this is that some older platforms define FILENAME_MAX to be 14, although MAXPATHLEN is 1024. On BSD-derived systems, FILENAME_MAX And MAXPATHLEN are both 1024. Bump pkg_install version to 20041226. These modifications have been tested so far on a NetBSD-current bulk build.
Update pkgtools/pkg_install to 20040813 (latest release from the HEAD
branch of src). Changes from version 20040730 include:
Modify pkg_info so that it will only print information on uninstalled
binary packages in the current working directory if -. is given on
the command line. If no -. is given, pkg_info will look for its
information in the ${PKG_DBDIR}. This addresses a long-held gripe on
the part of a number of people, including myself (agc), which completely
violated the POLS.
Add a -q switch to pkg_admin, which allows it to work in a quiet
manner. Fixes the change request in PR 26583, but in a different
manner, preserving existing behaviour and making the new behaviour
dependent upon a command line option.
Sync with version 20040730 from src/usr.sbin/pkg_install on the HEAD: > Re-work the code which checks the recorded build versions of a binary > package to make pkg_add work properly when no +BUILD_INFO file exists. > > Modify the return value from read_buildinfo() to return 1 for success > and 0 for failure. > > Use symbolic constants, rather than integers. > > If we can't read the build information, always tell of this fact. > > Bump version to 20040730 > > Addresses PR 26429; a different version of these mods were verified to > allow a +BUILD_INFO-less binary package to be added by Martin Husemann.
Bump version to 20030907. Changes from previous version include:
* Teaching pkg_add(1) to be smarter about how to add a depoted packge.
* "pkg_delete foo" only deletes foo if it's a unique package.
* Make "pkg_delete -O foo" for delete file entries for foo from
pkgdb.byfile.db actually work.
* Teach pkg_admin(1) two new commands "add" and "delete" for working
with pkgdb.byfile.db.
* pkg_view(1) uses the new pkg_admin(1) commands to keep the
pkgdb.byfile.db files consistent in each view.
* Man page fixes.
Whee... pkgdb_remove_pkg returns 1 on success, so make the dummy function return this value.
It turns out the comment at the top of pkgdb_open is wrong. It actually returns 0 if there is an error, and 1 otherwise.
The pkgdb_* functions should be no-ops on platforms that don't have the db*() functions, so make the dummy pkgdb_open() always return 0 for a successful open of the package dbfile.
Return the documented value "0" instead of EXIT_SUCCESS, which while it may happen to be "0", isn't what's being explicitly returned.
Put back several includes lost in the update that should fix builds on Solaris and Linux.
Sync to latest pkg_install sources from the HEAD for pkg_delete optimizations and man page fixes. Also use recent src2nbcompat to reverse the order that "config.h" and <nbcompat.h> are included in *.[ch] files.
Re-add the checks for HAVE_CHFLAGS and HAVE_DBOPEN so that this can build on systems that don't have either function.
Update pkg_install to 20030823, which has the changes to support package views. Pkgsrc changes include: * Convert to use pkgtools/libnbcompat so that it's easier to keep this in sync with src/usr.sbin/pkg_install. * Add a src2nbcompat script that converts src/usr.sbin/pkg_install into an appropriate start for pkgtools/pkg_install. The script removes the Makefiles, adds CPP inclusion guards around each #include <...> line, and includes <nbcompat.h> at the top of each *.c file. This should make it even easier to keep sources in sync with the HEAD.
catch up to bootstrap. bump PKGTOOLS_VERSION to 20030411.
Synch with main sources: Changes by hubertf and seb; these changes tested on NetBSD, Linux and Irix. Modified Files: src/usr.sbin/pkg_install/add: perform.c pkg_add.1 Log Message: Implement remaining TODO item in pkg upgrade (pkg_add -u): * Upgrade step 1/4: Check if the new version is ok with all pkgs * (from +REQUIRED_BY) that require this pkg Inspired by bsd.pkg.mk's upgrade(?) target. Modified Files: src/usr.sbin/pkg_install/admin: main.c src/usr.sbin/pkg_install/info: main.c perform.c Log Message: Consistently check findmatchingname() return value for error condition. Among other this fixes 'pkg_info -e whateverpkg' exit status when /var/db/pkg is missing: it is now 1 and not 0. Modified Files: src/usr.sbin/pkg_install/lib: version.h Log Message: Bump to "20030325" after today's changes from seb and me
Sync with main sources:
Date: Sat Mar 15 20:49:27 UTC 2003
Introduce a pkgdb_dump() function, which dumps the cache file of
(filename, package) pairs.
Modify calling functions to use pkgdb_dump() directly, rather than
sequences of
pkgdb_open
{ pkgdb_iter, pkgdb_retrieve }
pkgdb_close
calls.
Remove the now unnecessary pkgdb_iter function.
Date: Sat Mar 15 20:50:15 UTC 2003
Bump version string for pkgdb_dump changes.
Date: Sat Mar 15 20:54:26 UTC 2003
Catch one more place that could result in Current not being set properly
(and thus in the execution of "rm -fr /") if ^C is pressed at the wrong time.
See also PR 19436.
Pull up version 1.7 to the netbsd-1-6 branch. Requested by Grant Beattie. > Module Name: pkgsrc > Committed By: grant > Date: Tue Feb 18 15:45:51 UTC 2003 > > Modified Files: > pkgsrc/pkgtools/pkg_install/files/lib: pkgdb.c > > Log Message: > correct #ifdef misplacement.
correct #ifdef misplacement.
belatedly sync with src: In pkgdb_remove_pkg, only perform DB functions if HAVE_DBOPEN is defined, else return EXIT_SUCCESS unconditionally (as in other functions dealing with db functionality). fixes build problem on Solaris when no libdb is available.
Synch with latest changes from src (changes by agc, synch ok'd by agc) ---------------------------------------------------------------------- Add a pkgdb_remove_pkg() function and use it in pkg_delete(1). Bump lib/version.h due to added functionality. Order the getopt(3) options alphabetically. Introduce the notion of "preserving" an installed package. A preserved package may not be deleted by pkg_delete(1) (unless the -f option is given), and the preserved capability will be carried into any binary package. pkg_add(1) will also keep the preserved capability if it was present in the binary package. The "preserve" capability can be given to a package by using the PKG_PRESERVE definition in a package Makefile in pkgsrc. Ride on the recently-bumped lib/version.h for new functionality.
``On second thought, let's not go to Camelot. It is a silly place.'' (Make pkdb_open return pkgdbp!=NULL as src's does, and revert previous patch. As discussed with agc.)
sync with src: In pkgdb_remove(), use the return value from (*db->del), rather than explicitly setting and checking errno. Do some CSE in pkgdb_iter(). Use the db access functions in the proper manner. Also fix some whitespace nits.
Synch with basesrc: Use EXIT_FAILURE, rather than hardcoding a value of '1' in err(3) and errx(3). Plug a memory leak by modifying the signature of _pkgdb_getPKGDB_FILE() to take a buffer and its size, and fill in that buffer and return it. Add an enumerated type which is used in pkgdb_open() to specify read-only or read-write mode. Modify the return value of pkgdb_open() to have a more logical boolean value.
Import autoconf'd pkg_install source from
othersrc/bootstrap-pkgsrc/pkg_install into ${FILESDIR}.
Using autoconf greatly simplifies maintenance of this package across
multiple platforms. Placing the extracted source under ${FILESDIR}
will eventually let us use the same source for bootstrapping as
well, though we're not ready for this yet.
Initial revision