Commit Graph

116 Commits

Author SHA1 Message Date
Duncan Overbruck
ab3fb82a7f
lib: add binary package internalization step
- internalize scripts so we can use them before unpacking packages.
- moves some required metadata checks out of the package unpack stage
  so errors do not leave the system in a half unpacked state.

xbps_transaction_files will be changed later to use the loaded
files.plist instead of opening each binary package on its own again.
2021-06-26 18:41:37 +02:00
Érico Rolim
a95f3d56c8
lib/Makefile: fix linking for libxbps.so.
Both CFLAGS and LDFLAGS need to be passed during linkage as CFLAGS may
contain things that influence linkage (e.g. ssp_nonshared may be
necessary to link when using strong stack protector).

Pointed out by q66.

Closes: #330 [via git-merge-pr]
2021-02-04 23:15:11 +01:00
Érico Rolim
dc8c8c3868
lib/Makefile: guard -fvisibility=hidden flag. 2021-02-04 23:09:35 +01:00
Duncan Overbruck
51b39002e5
Revert "Move all external code to lib/external."
This reverts commit 9effec0c4e.
2021-02-04 22:42:57 +01:00
Juan RP
9effec0c4e
Move all external code to lib/external. 2020-04-24 12:32:09 +02:00
Juan RP
4990a2dd91 lib/Makefile: bump LIBXBPS_MICRO. 2020-04-14 20:27:54 +02:00
Juan RP
06c9891ae3 xbps_transaction_*: multiple performance improvements (v2).
This commit implements multiple performance improvements
to the transaction code:

- Don't process xbps_pkg_name() N times each time we access
  its package dictionary (via pkgdb or rpool), just do it once
  at xbps_pkgdb_init() time. At pkgdb init time, it just creates
  a property in pkgdb, "pkgname". At rpool time, each time a
  package is accessed, the "pkgname" string property is added.

- The package transaction dictionary contains the "transaction"
  object to know what's the pkg type. This has been changed to an
  uint8, this simplifies the logic and it's faster than checking
  a string object. See xbps_trans_type_t and xbps_transaction_pkg_type().

- Fixed the issue that was marked with XXX in transaction shlibs
  checking code. This has been fixed and improved and resources are
  now just freed as expected.

- Simplified random code all over the place, avoiding unnecessary
  allocations or operations.

- Rename some transaction files to have a better description.

This is my first rototill to the code in 2020.
2020-02-21 09:37:32 +01:00
Duncan Overbruck
0f61a1a5a2 lib/util_path.c: add some util functions to work with paths 2020-02-14 19:20:54 +01:00
Juan RP
6010a24de6 libxbps: ABI/API break due to xbps_pkg{,pattern}_name changes.
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.
2020-02-08 19:49:57 +01:00
Juan RP
95a3ba651f libxbps: added XBPS_FLAG_INSTALL_REPRO for xbps_handle::flags.
If set, enable reproducible mode; skips adding the
"install-date" obj into pkgdb.
2019-12-29 11:02:51 +01:00
Juan RP
6886a73288
Bump to 0.57.1 and libxbps micro. 2019-10-27 09:50:11 +01:00
Duncaen
143b13f9e6 lib/transaction_fetch.c: move fetch and verify binpkgs and make use of xbps_fetch_file_digest 2019-10-25 23:38:01 +02:00
Juan RP
0677678387 Added LTO support and fix warnings (maybe-uninitialized). 2019-06-27 18:09:26 +02:00
Juan RP
fcab44dbd3
lib/transaction_dictionary.c -> transaction_prepare.c. 2019-06-21 10:46:32 +02:00
Duncaen
6877d28139 lib/package_find_obsoletes.c: remove in favor of transaction file checks 2019-06-18 19:54:22 +02:00
Duncaen
29f1433afd lib/transaction_files.c: collect file installs/removals to correctly find obsoletes 2019-06-18 19:54:22 +02:00
Juan RP
363f5a93de lib/Makefile: disable pkgdb_conversion.c.
It was made many years ago to update the pkgdb format, but
it's innecessary to build it by default because is dead code.

Anyway keep it just in case pkgdb format changes.
2019-06-18 18:49:29 +02:00
Juan RP
04291329aa
Bump XBPS_API_VERSION and libxbps major soname.
- struct xbps_handle was modified.
- xbps_pkg_is_ignored() was added to the API.

Signed-off-by: Juan RP <xtraeme@gmail.com>
2019-06-14 09:54:51 +02:00
Duncaen
85bf13f138 lib: move conf parsing to lib/conf.c and refactor to not rely on getcwd/chdir
This fixes https://github.com/voidlinux/xbps/issues/158
2019-05-22 13:22:10 +02:00
Juan RP
0db5ace61d configure: fix vasprintf test; cosmetics.
The vasprintf test was always failing because it needed stdarg.h.
Misc cosmetics: rename compat objs to COMPAT_OBJS.
2019-04-22 15:30:02 +02:00
Enno Boland
a5bfc59203 prepare release 2018-07-30 13:47:08 +02:00
Juan RP
a13a7fa896 Implemented reverse conflicts for pkgs in pkgdb and transaction. 2015-10-28 05:23:42 +01:00
Juan RP
faeff38ca2 Alternatives framework (1/2) (WIP). 2015-10-18 10:38:35 +02:00
Juan RP
2aa844f3f7 lib/Makefile: remove some disabled warnings for lib{fetch,portableproplib}.
There's no need to set _GNU_SOURCE and disable those compiler warning flags.
2015-02-15 05:47:35 +01:00
Juan RP
b513a5e15e libfetch: misc cleanups due to nbcompat removal. 2014-12-28 03:34:36 +01:00
Juan RP
1bae26606e Introduce xbps_{pkgdb,rpool}_get_pkg_fulldeptree().
These routines return a xbps_array_t with a full sorted dependency graph
for the target pkg, by querying pkgdb or rpool.

Update xbps-query(8) to use the new libxbps API.
2014-11-20 09:23:51 +01:00
Juan RP
fb868454b2 libxbps: make sure to not add dups in transaction for install/update. 2014-10-19 11:00:40 +02:00
Juan RP
ff189fd210 Replaced redundant dependency sorting code with a simpler implementation.
This fixes the issue found by "xbps-src bootstrap" when a package
without "provides" was declared as a virtual package.
2014-10-18 12:35:47 +02:00
Juan RP
01dbb968dd Welcome pkgdb-0.38. 2014-09-11 00:12:12 +02:00
Juan RP
fb9c94fab9 Added support to use pkg shlib-{provides,requires} objects.
This effectively checks that all pkgs in a transaction to be installed
or updated, have not unmatched shared libraries, which might happen with
pkgs that had major soname bumps.

This implementation slow downs xbps_transaction_prepare() 2x, due to
the use of xbps_pkgdb_get_pkg_metadata(). A new pkgdb format is required
that adds the pkg shlib-provides objects to pkgdb, avoiding the need
to use xbps_pkgdb_get_pkg_metadata().
2014-09-09 11:08:54 +02:00
Juan RP
e92e86c2db Share code to show pre-remove/post-install msgs. 2014-07-27 17:39:24 +02:00
Juan RP
510c84d3bb libfetch: synchronized with NetBSD's pkgsrc/libfetch, preserving our changes. 2014-06-29 10:29:36 +02:00
Juan RP
19d36aaf04 portableproplib: use __attribute__((unused)) to fix a unused-but-set-variable warning. 2014-05-29 08:32:14 +02:00
Juan RP
cafbca06e7 Imported portableproplib-0.6.4. 2014-05-17 20:25:14 +02:00
Juan RP
447759941f Merge rpool_get.c into rpool.c. 2013-12-25 08:48:24 +01:00
Juan RP
ec0d38c469 Implement per pkg RSA signatures and on-demand repository access. 2013-12-24 10:43:55 +01:00
Juan RP
8d5c48b861 Added support for the long awaited feature: RSA signed repositories. 2013-10-05 11:38:04 +02:00
Juan RP
505a933097 Added support to verify reverse dependencies in a transaction.
See https://plus.google.com/106812073015308749022/posts/ZXMHimd8iKd
2013-06-27 16:52:31 +02:00
Juan RP
42c0766c00 Get rid of libfetch and proplib external dependencies.
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_.
2013-06-20 10:26:12 +02:00
Juan RP
31efece727 Hide libfetch symbols if using the internal copy. 2013-06-19 11:57:25 +02:00
Juan RP
99be698979 Use a single file to store repository data.
This is just the starting point to extend repositories with PGP signatures.
2013-06-10 10:28:39 +02:00
Juan RP
356f451d17 Renameed lib/package_remove_obsoletes.c -> package_find_obsoletes.c. 2013-03-09 17:21:27 +01:00
Juan RP
2c1e4e502d XBPS can now be built on NetBSD (and probably any other BSD variant). 2012-12-06 12:58:17 +01:00
Juan RP
f45352dbf8 Added support for dynamic generation of revdeps for installed packages. 2012-11-30 17:40:52 +01:00
Juan RP
8345070884 Bump libxbps soname major version. 2012-11-30 07:18:46 +01:00
Juan RP
63c1883201 Major API/ABI cleanup bringing performance improvements and fixes.
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.
2012-11-30 07:11:51 +01:00
Juan RP
b0fab7a3ee Implemented a cache to get pkg dicts from metadir.
This improves xbps-pkgdb -a marginally, but still seems to be a bit slow.
2012-11-16 21:50:52 +01:00
Juan RP
34bd49f85a New pkg metadata structure for 0.18. See the NEWS file for info. 2012-11-16 16:55:35 +01:00
Juan RP
11ecf5438f Import proplib-0.6.1. 2012-07-10 23:33:19 +02:00
Juan RP
c61ba8dfcc Added support for package conflicts. 2012-06-11 16:14:03 +02:00