Commit Graph

114 Commits

Author SHA1 Message Date
Duncan Overbruck
2deb156beb
lib: only include fetch.h where required
This results in a lot of places where limits.h was missing, so
this diff is larger than necessary.
2022-12-22 16:47:05 +01:00
Duncan Overbruck
2dc22401d5
lib: drop libarchive compat macros and use non deprecated functions 2021-06-26 18:51:15 +02:00
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
0b23de1bec
__UNCONST: use uintptr_t instead of unsigned long.
The width of unsigned long matching the width of a pointer isn't
guaranteed by any standard, though it is a requirement of the Linux
syscall API. Using uintptr_t directly is always correct.
2021-02-04 23:04:59 +01:00
Duncan Overbruck
44cd938115
Revert "Use shared LICENSE file for all xbps code."
This reverts commit be7d8cfaf1.

This commit missed some previous copyrights mentioned,
in general I think its better to have this per-file to
follow who wrote what and when.
2020-04-29 14:12:10 +02:00
Juan RP
be7d8cfaf1
Use shared LICENSE file for all xbps code. 2020-04-24 11:44:19 +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
Juan RP
d2208f91e0
Revert "Verify repodata signature"
This reverts commit a7830cf780.
2020-01-06 14:33:49 +01:00
Piotr Wójcik
a1481cb285 Verify index-meta for in-memory sync 2019-11-02 11:53:14 +01:00
Piotr Wójcik
a7830cf780 Verify repodata signature 2019-11-02 11:53:14 +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
Duncan Overbruck
f103b91663 Revert "lib/transaction_{revdeps,prepare}.c: try to update packages if necessary"
This reverts commit 0e950156fc.
2019-08-05 11:48:15 +02:00
Duncaen
0e950156fc lib/transaction_{revdeps,prepare}.c: try to update packages if necessary
`xbps_transaction_revdeps` will now try to add updates for packages to the
transaction if the dependency is not satisified anymore due to a package
install/update.

`xbps_transaction_prepare` will now check the return value of
`xbps_transaction_revdeps` and repeat the dependency resolution,
until `xbps_transaction_revdeps` returns 0, which means that it didn't
add any new packages to the transaction.
2019-07-03 00:48:57 +02:00
Duncaen
658f87b9c5 lib/transaction_files.c: rework to remove obsoletes before unpacking 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
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
Duncaen
ea2cb1d369 unpack: keep conf_files replaced with symlinks, unpack as .new-pkgver 2019-04-20 10:56:08 +02:00
Michael Gehring
a2aec39d74 lib/package_unpack.c: refuse to unpack to absolute paths 2017-07-13 17:17:12 +00:00
Juan RP
35ad10ccbd Fix 29765271e correctly.
xbps_find_virtualpkg_in_conf() needs to look at the vpkgs set up in
configuration files, not from those set by pkgdb.

As a result of this the two test cases that were failing yesterday are now
fixed.
2016-03-24 10:23:20 +01:00
Juan RP
29765271e9 xbps.d(5): 'virtualpkg' can now be used to map any pkg to another.
See NEWS for more information.
2016-03-23 12:46:52 +01:00
Juan RP
a13a7fa896 Implemented reverse conflicts for pkgs in pkgdb and transaction. 2015-10-28 05:23:42 +01:00
Juan RP
8081751f86 libxbps: print in verbose mode what pkgs are added to the transaction.
Useful to know why a transaction cannot be completed when there are
unresolved reverse dependencies.

Requested by @chris2.
2015-09-02 18:56:20 +02:00
Juan RP
441f147f05 Fix reinstallation of pkgs in repolock mode.
At the time we've been searching for the pkg in a repo, no repos
were registered resulting in EINVAL. While here, if there's no
declared repos return ENOENT instead.
2015-03-05 21:23:58 +01:00
Juan RP
ae8ce64542 Restore pkg file timestamps while unpacking as regular user.
Requested by @dominikh.
2015-02-21 16:52:27 +01:00
Juan RP
eee895c6d8 Fixed a regression in vpkgs and improve xbps.d(5) virtualpkg declarations.
See the NEWS file for more information.
2014-12-31 08:51:45 +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
a6516505e9 xbps-query(8: added --cat=FILE mode support.
- This mode prints to stdout the matching FILE stored in a binary package.
- ABI break: renamed xbps_get_pkg_plist_from_binpkg() xbps_binpkg_get_plist().
- Added xbps_binpkg_get_file() as a generic way to get pkg file contents.
- Removed useless comments from xbps_api_impl.h.
2014-11-17 15:45:46 +01:00
Juan RP
3afb9d709d Get rid of repodata index-files; the archive is now 8x smaller.
See the NEWS file for more information.
2014-11-13 17:09:43 +01:00
Juan RP
627a5afaaf Make sure that automatic/manual installation modes are set as expected. 2014-10-20 07:59:06 +02:00
Juan RP
231582e671 libxbps: make sure to not add dups in transaction for remove. 2014-10-19 11:22:17 +02: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
c9514ad617 libxbps: fixed replaces/replace_vpkg test case. 2014-09-14 12:50:17 +02:00
Juan RP
dea31f0a15 Add xbps_remove_{pkgname,string}_from_array() to the API. 2014-09-13 18:13:25 +02:00
Juan RP
ed6b3c00f5 xbps_entry_install_conf_file: fix non debug build. 2014-09-11 11:56:23 +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
b980e2109f include/xbps_api_impl.h: confuse.h is not necessary anymore. 2014-02-25 17:04:13 +01:00
Juan RP
f74bf1c1c8 New custom configuration file format that does not need confuse. 2014-02-25 16:42:52 +01:00
Juan RP
4d1cdcac0c Fix concurrency issues in pkgdb: only allow 1 write transaction at the same time.
This implementation relies on a POSIX named semaphore, which is also
required by xbps-rindex(8).
2014-02-23 08:23:14 +01:00
Juan RP
596a8c199f Improve two phase pkg removal: do the check for all entry types. 2014-02-09 12:53:15 +01:00
Juan RP
5eea259c13 Remove the config.h kludge and override vasprintf detection via HAVE_VASPRINTF. 2014-01-20 18:50:33 +01:00
Juan RP
3042dcd7aa include/xbps_api_impl.h: remove __{BEGIN,END}_DECLS to make musl happy. 2014-01-07 21:19:03 +01:00
Juan RP
35e4182250 Fully remove the obsolete softreplace code. 2013-12-25 11:12:52 +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
2a21354a1c Make some reorganization in struct xbps_handle.
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.
2013-12-16 11:46:39 +01:00
Juan RP
1f16a22791 Add NDEBUG to CPPFLAGS if --enable-debug is unset. 2013-12-06 11:55:08 +01:00
Juan RP
2952c69c7a Define NDEBUG for assert() if --enable-debug is not specified. 2013-11-08 09:11:47 +01:00
Juan RP
a5ecaa493f New utility: xbps-rkeys(8) to manage RSA public keys. 2013-10-09 10:13:07 +02:00