Commit Graph

33 Commits

Author SHA1 Message Date
Duncan Overbruck
6d940e647f
lib/transaction_files: fix reinstall removal of shared directories 2023-06-24 18:56:31 +02:00
Duncan Overbruck
de484e9369
lib: change xbps_dbg_printf to not require xbps_handle
This allows to simplify a lot of code by not having to pass around
the xbps handle everywhere just to print some debug information.
2022-12-24 14:29:23 +01:00
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
9139c4469f
lib/transaction_files.c: document some details 2021-06-26 18:58:55 +02:00
Duncan Overbruck
62962208fd
lib/transaction_files.c: fix leaving behind obsolete directories
Deleting obsolete directories is different from deleting obsolete files,
files need to be deleted by the first package that might change the file
into a different file type.
Directories need to be deleted by the last package that removes files
out of the directory to avoid ENOTEMPTY if another package has a file in
the given directory which is uninstalled later.

This fixes #282.
2021-06-26 18:58:55 +02:00
Duncan Overbruck
2dc22401d5
lib: drop libarchive compat macros and use non deprecated functions 2021-06-26 18:51:15 +02: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
83d87ce05b
lib/transaction_files.c: fix CID 284958 (Resource leak). 2020-04-19 11:17:02 +02:00
Duncan Overbruck
c3830670f8 lib/transaction_files.c: cleanup memory 2020-02-23 22:18:34 +01:00
Duncan Overbruck
64f96ec940 transaction_files.c: port to uthash 2020-02-23 22:18:34 +01: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
0d90534236
libxbps: ABI/API break due to hash function changes 2020-02-10 13:32:17 +01:00
Juan RP
c4019aa923
xbps_transaction_files: fixed another memleak.
Thanks valgrind
2020-02-08 20:22:42 +01:00
Juan RP
58217d412d
xbps_transaction_files: fix a memleak.
Thanks valgrind!
2020-02-08 20:08:03 +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
d2208f91e0
Revert "Verify repodata signature"
This reverts commit a7830cf780.
2020-01-06 14:33:49 +01:00
Piotr Wójcik
a7830cf780 Verify repodata signature 2019-11-02 11:53:14 +01:00
Duncan Overbruck
f0d62b9a80 lib/transaction_files.c: fix conf handling
This only changes the debug messages, because modified files and conf
files are handled the same on removal and unless a conf file changes
the file type it is never deleted.
2019-08-06 13:49:42 +02:00
Duncan Overbruck
fa23602561 lib/transaction_files.c: rename remove to removepkg to not shadow remove(3) 2019-08-05 15:56:04 +02:00
Duncan Overbruck
f0d90d3fec lib/transaction_files.c: prepare to use obsolete files detection on package removal 2019-08-05 14:55:21 +02:00
Juan RP
0677678387 Added LTO support and fix warnings (maybe-uninitialized). 2019-06-27 18:09:26 +02:00
Duncaen
d72091a206 lib/transaction_files.c: fix returning error on hash mismatch 2019-06-26 13:07:16 +02:00
Juan RP
4f717dc597 xbps-install(1): added -I, --ignore-file-conflicts.
If set it will continue with the transaction and will
just print what are the conflicting files without returning
EEXIST.

This is a temporary solution for void where there are still
some packages with conflicting files (qt5-host-tools vs qt5-tools-devel).

With input by @duncaen
2019-06-21 15:31:04 +02:00
Juan RP
9a72aaf577
xbps_transaction_files: report all conflicting files not just the first. 2019-06-21 13:48:47 +02:00
Duncaen
70867bd774 lib/transaction_files.c: fix size_t printf 2019-06-20 18:04:47 +02:00
Duncaen
dc547d9f50 lib/transaction_files.c: skip preserved files while looking for obsoletes 2019-06-20 14:53:08 +02:00
Duncaen
8837e8c607 lib/transaction_files.c: better handle preserve files 2019-06-18 19:54:22 +02:00
Duncaen
f2b119ef31 lib/transaction_files.c: better error and debug messages and minor cleanup 2019-06-18 19:54:22 +02:00
Duncaen
0efb59a979 lib/transaction_files.c: fix undefined behaviour 2019-06-18 19:54:22 +02:00
Duncaen
f45c6798c9 lib/transaction_files.c: update package archive compressions 2019-06-18 19:54:22 +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