It should be provided in the proplib dictionary with key 'automatic-install'.
This fixes a regression not respecting the 'automatic-install' value stored
in regpkgdb.
Two new booleans were added to struct xbps_handle: install_reason_{auto,manual}.
The backend is able to force auto or manual installation for a package (and
dependencies that were installed/updated) by setting to true any of those
booleans. Bump XBPS_RELVER.
That means that the following functions were removed:
- xbps_set_{cachedir,flags,rootdir}.
- xbps_get_{cachedir,flags,rootdir}.
With this change fixed an obvious typo that made -c argument to not work,
and now the cache directory is an absolute path not relative to rootdir.
This structure sets up function callbacks for fetching files and
unpacking binary packages, as well as setting the debug boolean.
This way the affected functions (xbps_fetch_file() and
xbps_unpack_binary_pkg()) do not need to accept the fn cb pointers
and data as arguments.
Bump XBPS_RELVER.
A new function xbps_find_virtual_pkg_in_dict() has been made public
to the API to make this find duplicate packages in the transaction
when updating packages.
The patch adds 150 lines approximately. It is implemented by modifying
xbps_find_pkg_in_dict_by_name() and xbps_find_pkg_in_dict_by_pattern().
When no dictionary is returned if tries to find a virtual package by
looking at the "provides" array object, if found.
This also makes xbps_unpack_binary_pkg follow this convention by avoiding
static variables.
--HG--
branch : progress_callback
rename : bin/xbps-repo/util.c => bin/xbps-bin/util.c
So now its prototype is the following:
int xbps_humanize_number(char *buf, int64_t bytes)
It is a wrapper around NetBSD's humanize_number(3) which uses 6 digits for max
length, HN_AUTOSCALE and HN_NOSPACE|HN_DECIMAL. All users have been updated.
This function replaces xbps_repository_get_path_from_pkg_dict() and
xbps_get_binpkg_local_path(). It takes a pkg dictionary as returned
by a repository pkg index or a transaction dictionary and returns
a string with the full path to the binary pkg, either in local
repos, cachedir or remote repos.
Update all code to use this function... sorry I broke ABI compatiblity.
prop_dictionary_t xbps_repository_pool_find_pkg(const char *pkg, bool bypattern, bool best)
This function iterates over the repository pool and returns a pkg
dictionary matching its pkgname if "bypattern" is false, otherwise
if "pkg" matches the pkgdep pattern. If "best" is true, it will look
in all repos and will return the newer version, otherwise the first one
that matches the arguments specified.
With this addition supporting many small registered repos is cheap, because
it checks by-package rather than by-package-list. This also helped to removed
some duplicated code and fix some rare bugs.
Bump XBPS_RELVER to 20110118.
- Rename regpkgs_dictionary to regpkgdb_dictionary to better describe what is is.
- Change some funcs in plist.c to return a boolean rather than int.
- Hide more internal funcs off the API.
- Simplify xbps_repository_update_pkg() and remove its second arg.
- Hide implementation details in xbps_repository_pool, now to iterate over the
pool you have to use xbps_repository_pool_foreach and its struct
repository_pool_index.
- Introduce xbps_{init,end}, to initialize/destroy some stuff in the library.
- Introduce xbps_dbg_printf to printf stuff for debugging purposes.
- xbps-{bin,repo}: added -d arg to enable debugging output.
- Before checking if a config file needs to be installed or such, check that
package contains the "conf_files" array.
- Remove obsolete dirs as well while updating packages.
- If transaction dictionary is ready remove the "missing_deps" array.
Bump XBPS_RELVER to 20101118.
--HG--
rename : lib/regpkgs_dictionary.c => lib/regpkgdb_dictionary.c
This function returns and internalized dictionary from a package's metadata
plist file as specified by its arguments.
Update all code to use it where appropiate.
* libxbps: improved xbps_get_file_hash() to mmap(2) rather than read(2)
the file we have to process. With mmap'ed files the hash can be
processed 5x faster than before, or even more in some cases.
* libxbps: switch to OpenSSL SHA256 implementation and remove the one
previously used. It's faster and OpenSSL is required for libfetch so
there is not point in using it.
Changes included in this set:
* Added strlcat() and strlcpy() from OpenBSD, always use them if the
system does not have them built in.
* Changed an array of PATH_MAX size allocated in the stack, to a dynamically
allocated buffer from heap. This should reduce memory usage a bit.
* Simplify code that implemented a homegrown realpath(3) implementation,
simply use realpath(3).
* If compiler supports -fstack-protector, build all code with
-D_FORTIFY_SOURCE=2 and --param ssp-buffer-size=1 so that all
buffers are protected.
* libxbps: while running INSTALL/REMOVE scripts, do not fail if a script
returns ENOENT but the script exists; that means the script did not match
the expected action on its switch statement and the fact can be simply
ignored.
* libxbps: while upgrading packages and searching for obsolete files,
do not remove the files that did not match previous SHA256 hash. Also,
only remove obsolete dangling symlinks.
* Add proplib-0.4.1 source and use it in XBPS. This is to avoid
an external dependency, so that we depend on the features of the
internal library. This also means that proplib is not required anymore.
* Added support to read/write gzip compressed plists by default, thanks
to proplib-0.4 that gained new functionality.
That means that from now, XBPS will be able to write compressed gzip
plist files for all metadata related work. This will vastly reduce
bandwidth required for fetching remote repo's pkg index file and
binary packages.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100420122238-zcb85rudt9p34e10
This helps to catch upgrade problems and simplifies some parts of the code.
Bumped XBPS_RELVER because xbps_remove_pkg() has been changed.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100128150850-gcs93su38t6moydn
xbps_fetch_cache_connection() if 0 is passed as argument.
xbps-bin: enable fetch cached connection when downloading binpkgs.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100124153156-4updprik11nwi7c1
- use printf to print commands rather than echo, which it may not have
support for escape sequences (-e).
- Remove DESTDIR from SBINDIR, MANDIR, LIBDIR and INCLUDEDIR so that
you can override it.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100124125958-8mscedj5ntf288jd
doxygen and graphviz are required. It's disabled by default, use
the BUILD_API_DOCS make(1) argument to enable it.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100123013719-pkk3a3823cx09v8l
Some changes were made to the API when making the documentation:
- A few exported functions are now hidden, because they were only used
internally in the library.
- A few exported symbols were renamed to document them better than
previously.
- Cosmetic changes all along the way, as well as some fixes here and there.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100121021019-onbsivlrhdb7t3ou
* A package failed to be upgraded properly if current pkg contained
INSTALL/REMOVE scripts, while the new one didn't have any of them.
Fixed this by always removing current scripts if they exist.
* Essential pkgs are never removed (they are replaced) so the pre remove
action target was never called, now it all works properly.
Bumped XBPS_RELVER because I consider these bugs so important.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100118184932-pdsb0djvf0swylm3
https://blueprints.launchpad.net/xbps/+spec/install-pkg-by-pkgmatch
The implementation works as expected, it was easier that I thought.
Bump XBPS_RELVER because the API was changed slightly.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100114011431-xv5q6bgahm6v9dbq
A new function has been created, xbps_remove_pkg_files() that accepts
a dictionary internalized from files.plist and a key to remove
links, dirs, files and conf_files.
As result of this, now when purging a package those directories that
were used in configuration files will also be removed if they are empty.
Bump XBPS_RELVER to 20091207.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091207053006-egw65u6y1jcuraje
to not remove files in removal or upgrades.
Bump XBPS_RELVER to 20091202.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091202053103-uby6hwu313pieafa
libxbps:
* Added xbps_set_cachedir() and xbps_get_cachedir(). By default it's
set to /var/cache/xbps if not specified and it's always relative
to the root directory.
* Move mkpath() code from sync_remote_pkgidc.c into its own file mkpath.c
to use it in another parts of the code.
* Added xbps_get_binpkg_local_path(), that returns the local path to
a binary package file, stored in cachedir or local repo.
* Remote pkg index files are now stored directly in metadir/repodir,
skipping the arch directory because binpkgs are now in cachedir.
xbps-bin:
* Added -c flag to set the cachedir.
* Check sha256 hashes in the download stage so that it can check
a downloaded binpkg immediately once is stored.
* If a binpkg doesn't match the hash it will be refetched.
Bump XBPS_RELVER to 20091128.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091128013841-kkcvk07lsqdr26w8
libxbps:
- Moved repolist code to lib/repository_pool.c.
- Renamed xbps_{prepare,release}_repolist_data() to
xbps_repository_pool_{init,release} respectively.
- Moved regpkgdb dict code to lib/regpkgs_dictionary.c.
- Renamed xbps_{prepare,release}_regpkgdb_dict() to
xbps_regpkgs_dictionary_{init,release} respectively.
- Use a global reference count for repository_pool and regpkgs_dictionary,
this gives a substantial performance gain while looking for dependencies
in repository pool, among other things.
- Make xbps_find_pkg_* functions return errno and use it to detect
for spurious errors in code using them.
- Add code to detect when a dependency is already unpacked.
xbps-bin:
- Do not set pkg state to unpacked in the transaction, it's set already
while a package is unpacked.
- While installing or updating packages, it now knows when a dependency
is already unpacked and shows it as "unconfigured".
Bump XBPS_RELVER to 20091126.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091126022250-uu8x0fa86l4scb5x
from an url into a new function, xbps_get_pkg_plist_dict_from_url.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091125025258-dnq0lstx67xj6w8t
It will search for 'pkgname' and will print its list of files, by
searching it in repository pool. The first repo wins.
Bump XBPS_RELVER to 20091125.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091125021556-n8p6atfbkuvb4doi
This function will fetch a requested plist file in a binary
package matching its 'pkgname' object by searching in repository pool.
This works in any kind of repository, local and remote. Some code
was Taken from NetBSD's pkg_install HEAD. Oh, and it's on-the-fly!
doesn't need to download the binpkg first!
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091125020936-7uf2ncrf1692c5hz
xbps-fetch and xbps-pkgdb in one utility.
Bump XBPS_RELVER to 20091124-1.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091124115947-hb9cp7vp3tyhq64o
As consequence of this, remove xbps_callback_array_iter_in_repolist().
Nowadays to iter over the repository pool we have a SIMPLEQ, this
allowed to simplify the code and remove some now unneeed stuff.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091124104704-oyvrmb3tmd59w4e7
remote repositories, so remove its argument.
xbps_sync_repository_pkg_index:
- create the local repo dir in XBPS_META_PATH.
- also add the uri scheme (http://, https://, ftp://) in the created
local directory and subst ':' also with an underscore.
- do not create local repo directories unless the download pkg-index
plist file is verified to be fetched correctly.
xbps_check_is_repo_string_remote:
New function to check if a repo string is a remote repository, use
it in all places where it was used before.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091123042316-rmu4w3ehoxwh3iz8
in pkg dictionary to improve performance in some cases.
Bumped XBPS_RELVER to 20091121.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091122041547-oywx4db75j8uttl3
dependencies, as specified in blueprint "improved-version-matching".
It's possible now to require greater, greater or equal than,
less, less or equal than, and equal pkg versions, as well as using
'{}' and '[^!]' csh patterns in dependencies.
Code lifted from FreeBSD, thanks! :-)
Change XBPS_RELVER to 20091107 to match latest additions.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091107035620-3051wcwrirqn2g14
fetchLastErrString.
Hook xbps-fetch to the tree and use the new function to print errors.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091030021303-6wu9sri5o8kgvfwl
libfetch from NetBSD's pkgsrc has been imported into lib/fetch, but
the objects are embedded into libxbps. Only a public function to fetch
files has been implemented: xbps_fetch_file().
The library now is built with -fvisibility=hidden by default, and
exported symbols are the ones that use the SYMEXPORT macro.
The code works well enough, but will need many more cleanups.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091027004600-0lq9aao67lisbzxv
version of xbps (utils and libraries).
Will be used by xbps-src in the future to require a minimal version.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091018082352-7m4nd0psac5vplg8
state in the object dictionary rather than opening and externalizing
the dictionary of every package.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20090821093126-0xw980x0pqtq59q2