The funcs xbps_pkg_name() and xbps_pkgpattern_name() were
using malloc(3) to return the result, until now.
They now have been changed to not allocate the result
via malloc, the caller is responsible to provide a buffer
at least of XBPS_NAME_SIZE (64).
If for whatever reason the pkgname can't be guessed,
returns false. This should avoid lots of small allocs
around libxbps.
New functions have the following prototype:
bool xbps_pkg_name(char *dst, size_t len, const char *pkg)
bool xbps_pkgpattern_name(char *dst, size_t len, const char *pkg)
as suggested by @duncaen.
Add 'digest' and 'fetch' actions again for compatibility,
but don't mention them in usage().
This way previous versions of xbps-src (that don't require xbps-0.54)
still work without changes.
See the manual page:
XBPS-DIGEST(1) General Commands Manual XBPS-DIGEST(1)
NAME
xbps-digest - XBPS utility to generate message digests
SYNOPSIS
xbps-digest [OPTIONS] [FILE] [FILE+N]
DESCRIPTION
The xbps-digest utility generates message digests for specified FILE or
stdin if unset.
OPTIONS
-m, --mode mode
Sets the message digest mode. Supported: sha256. If unset, defaults
to sha256.
-h, --help
Show the help message.
-V, --version
Show the version information.
SEE ALSO
xbps.d(5), xbps-checkvers(1), xbps-create(1), xbps-dgraph(1),
xbps-fbulk(1), xbps-install(1), xbps-pkgdb(1), xbps-query(1),
xbps-reconfigure(1), xbps-remove(1), xbps-rindex(1), xbps-uchroot(1),
xbps-uunshare(1)
AUTHORS
Juan Romero Pardines <xtraeme@gmail.com>
BUGS
Probably, but I try to make this not happen. Use it under your own
responsibility and enjoy your life.
Report bugs at https://github.com/void-linux/xbps/issues
June 12, 2019
Signed-off-by: Juan RP <xtraeme@gmail.com>
The "architecture" configuration keyword is now available to override
the native machine architecture returned by (uname(2)).
The XBPS_ARCH environment variable still has preference.
xbps-uhelper now supports downloading files with a defined destination.
The syntax of fetch is "URI>FILENAME". So if you call
xbps-uhelper fetch "http://foobar.com/foo.tar.gz>bar.tar.gz"
the output file will be named "bar.tar.gz"
The variables to set cachedir, rootdir and metadir have been
changed to "array of chars", this way there are no extra allocations.
Update clients accordingly and bump API version.
- This prints to stdout the version of an installed "real" package,
not virtual. The 'version' action can be used to match any "real" and
"virtual" package instead.
- Drop strcasecmp() to check actions and use strcmp() instead.
The list of required external deps is now confuse, libarchive and openssl.
libxbps now includes a wrapper for proplib prefixed with xbps_ rather than prop_.
These are the core interfaces in the new API:
rpool - Interface to interact with the repository pool.
rindex - Interface to interact with repository indexes.
pkgdb - Interface to interact with local packages.
transaction - Interface to interact with a transaction.
This also brings new repository index format, making the index file
per architecture and being incompatible with previous versions.
The transaction frequency flush option has been removed, and due to
the nature of package states it was causing more harm than good.
More changes coming soon, but the API shall remain stable from now on.
xbps_fetch_file:
- A temp file is created with .part extension to improve resuming.
- Files are downloaded in cwd.
- Switch to futimens(2) and fsync(2).
xbps_repository_sync_index:
- Do not create local repodir in metadir if it already exists.
- Simplify the code thanks to new xbps_fetch_file().
There's no need to prop_dictionary_copy the returned dictionary to
later have to free it again, just return directly the dictionary and
avoid the free(3)s.
The third optional argument "pkgver" clearly is useless because we can
create it internally with "pkgname" and "version" arguments instead.
Also make the "version" argument mandatory.
- xbps_handle::transd -> new member with transaction dictionary.
- xbps_transaction_prepare: returns an int.
- xbps_transaction_commit: doesn't need any arg now.
- xbps_repository_pool_sync: doesn't need any arg now.
- xbps_pkgdb_update: removed xbps_handle * arg.
- xbps_transaction_missingdeps_get: removed, missing_deps array is in
xbps_handle::transd("missing_deps") array object.
- xbps_repository_pool_find_pkg in best match case, now returns the
newest package version available in rpool.
- Added xbps_repository_pool_find_pkg_exact that returns a package
by exact matching a pkgver.
- Removed xbps_handle_alloc(), the user is free to use memory
allocated from heap or stack.
- Improved API documentation in preparation for 0.12.
Bumped XBPS_API_VERSION again.