Commit Graph

3668 Commits

Author SHA1 Message Date
Duncan Overbruck
92a21db4da
lib/transaction_ops.c: do not change the transaction mode of unpacked packages
Those packages are going to be either updated or uninstalled,
changing the transaction type breaks this.
There is no apperent reason to change the type anyways.
2021-06-26 18:46:56 +02:00
Duncan Overbruck
9763a36cea
NEWS: add INSTALL/REMOVE script changes 2021-06-26 18:42:43 +02:00
Duncan Overbruck
dc0dda15f6
tests: add test for various script actions
Closes: #410 [via git-merge-pr]
2021-06-26 18:41:37 +02:00
Duncan Overbruck
59bcbddcdb
lib/package_script.c: xbps_pkg_exec_script: remove useless copy and free 2021-06-26 18:41:37 +02:00
Duncan Overbruck
1f99a099e8
lib: run all post/purge-remove scripts at the end of the transaction 2021-06-26 18:41:37 +02:00
Duncan Overbruck
02367e3c00
lib: run pre-remove and pre-install scripts before unpacking 2021-06-26 18:41:37 +02:00
Duncan Overbruck
c94648630c
lib/transaction_commit.c: don't configure already unpacked packages early
This makes --unpack-only also skip the configure for currently unpacked
packages and configures unpacked packages together with all other
pckages.
2021-06-26 18:41:37 +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
Duncan Overbruck
c00fe9f3e1
lib/util.c: make is_revision match the code style 2021-06-26 17:14:23 +02:00
Juan RP
46b7057d91
Fix signed vs unsigned char issues found by NetBSD. 2021-06-26 17:13:01 +02:00
Juan RP
18a2a2b0a7
configure: use command -v rather than which(1). 2021-06-26 17:07:16 +02:00
Duncan Overbruck
778dbab22b
NEWS: update 2021-06-26 17:02:26 +02:00
Duncan Overbruck
72395cdf80
tests: add test for configuration key/value formatting
Closes: #412 [via git-merge-pr]
2021-06-26 17:02:26 +02:00
Duncan Overbruck
248ca4b152
lib/conf.c: cleanup a bit 2021-06-26 17:02:26 +02:00
eater
453595a822
lib/conf.c: strip whitespace after value in config
Closes: #407 [via git-merge-pr]
2021-06-26 17:02:26 +02:00
Piotr Wójcik
18416e2de8
xbps-checkvers: list installed subpackages
Subpackages without main package installed wasn't reported
at all. This can produce duplicates in output, but checkvers'
output isn't good to loop over without passing through
./xbps-src sort-dependencies anyway.

Closes: #404 [via git-merge-pr]
2021-06-26 16:58:45 +02:00
Piotr Wójcik
9f5a029a3f
dewey.c: convert to UTF-8
Closes: #396 [via git-merge-pr]
2021-06-26 16:57:04 +02:00
Duncan Overbruck
f86aeebd3e
bin/xbps-create: stop storing mtime in files.plist
Closes: #390 [via git-merge-pr]
2021-06-26 16:55:11 +02:00
Duncan Overbruck
cdb0121a99
bin/xbps-pkgdb: we don't rely on mtime anymore, the check is useless 2021-06-26 16:55:11 +02:00
Duncan Overbruck
e9411eda81
lib: remove mtime updating on unchanged files 2021-06-26 16:55:11 +02:00
Đoàn Trần Công Danh
6122bff7fa
compat: correct HAVE_HUMANIZE_NUMBER typo
It should be HAVE_HUMANIZE_NUMBER instead of HAVE_HUMANIZE_HUMBER, from
the name of humanize_number(3).

It's mispelt only in this file, the configure script gets it correctly.

Closes: #334 [via git-merge-pr]
2021-06-26 16:54:03 +02:00
Piotr Wójcik
379cd4da2c
xbps-install: in dry run mode, print transaction even when disk is full
Closes: #322 [via git-merge-pr]
2021-06-26 16:51:43 +02:00
Daniel T. Borelli
024c4cc75d
bin/xbps-create: fix incorrect assert variable
Closes: #309 [via git-merge-pr]
2021-06-26 16:50:05 +02:00
Duncan Overbruck
66f84a8b59
bin/xbps-fetch: exit with failure if there was a failure in any of the downloads 2021-06-26 16:47:25 +02:00
Duncan Overbruck
9cd3f8d0bf
bin/xbps-fetch: fix printing uninitialized shasum in error cases 2021-06-26 16:45:10 +02:00
Duncan Overbruck
5dbe040b75
xbps-install.1: fix lint warnings 2021-06-26 16:43:07 +02:00
Alexis
c797c7fbc4
xbps-install.1: Add further details about -n.
Closes: #281 [via git-merge-pr]
2021-06-26 16:29:41 +02:00
Érico Nogueira
b18499a62d
bin/xbps-query: use fwrite directly.
Avoids allocations and an unnecessary loop (and printf usage, fputs
would have been enough).

Closes: #401 [via git-merge-pr]
2021-06-26 16:07:59 +02:00
Érico Nogueira
08ad0c2a9b
lib/package_msg: don't roundtrip data with fmemopen
Using fmemopen here wasn't necessary, since memcpy could have been used
with way lower overhead. We don't use a dedicated function, because
turning a data field into a string is an inefficient operation and
shouldn't be encouraged.

Also don't initialize data when it's declared, it isn't necessary.
2021-06-26 16:06:55 +02:00
Piotr Wójcik
4a5eb8dc87 tests: fix one case not using rootdir 2021-03-12 23:07:11 +01:00
Piotr Wójcik
d67b87ab47 ci: migrate to openssl 2021-03-12 23:07:11 +01:00
Érico Rolim
01180f9cb6
lib/repo: change some error handling in repo_open_local.
- use less intermediate variables
- assert that archive_read_new managed to allocate memory for itself:
  not ideal, but if we ever want to move from assertions it shows us
  where we need to change things
- use libarchive's archive_error_string for better error messages

Closes: #345 [via git-merge-pr]
2021-02-04 23:54:07 +01:00
Érico Rolim
d8cf66ce36
xbps-checkvers.1: fix case of -I option.
Closes: #307 [via git-merge-pr]
2021-02-04 23:49:30 +01:00
Duncan Overbruck
9a30f13300
lib/initend.c: only use uname(3) if native_arch was not set
if the configuration file or the env variable is used
we can skip uname(3).
2021-02-04 23:38:32 +01:00
Duncan Overbruck
c6aaafb123
lib/initend.c: allow XBPS{,_TARGET}_ARCH variables to overwrite config 2021-02-04 23:27:11 +01:00
Piotr Wójcik
b26f4068b7
xbps-install: list reinstalled packages
Before, they weren't printed at all.
Additionally, this matches count from compute_transaction_stats.

Closes: #321 [via git-merge-pr]
2021-02-04 23:16:50 +01:00
gt7-void
167289d590
Avoid file descriptor leakes (fix #303)
HTTP connections are cached for performance, but they end up being
leaked when running configure scripts. To avoid this, close the
connection cache after all downloads are finished.

Closes: #326 [via git-merge-pr]
2021-02-04 23:16:27 +01:00
Arsen Arsenović
1263b6607f
bin/xbps-rindex: fix a leak in load_rsa_privkey
Closes: #327 [via git-merge-pr]
2021-02-04 23:15:36 +01: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
9c5443d134
fetch/http: add missing case when treating status code.
The HTTP_REDIRECT() macro already included this case, but the
switch-case with the return value of http_get_reply(conn) didn't. This
made it so that a server returning HTTP_TEMP_REDIRECT (307) would
generate a failure, unless libfetch was used in verbose mode, in which
case the headers would be parsed (in order to report errors), then the
'Location' header would be found and a new connection would be made.

Fixes #348
2021-02-04 23:14:34 +01:00
Érico Rolim
2047dac6a0
xbps-fetch: use standards compliant struct initializer.
Initializing structs with '{}' is supported on most compilers, but not
defined in the standard. The correct initializer for this is '{0}'.

Spotted with cproc.
2021-02-04 23:09:36 +01:00
Érico Rolim
456f07c218
proplib_wrapper: remove return from void functions.
Spotted while trying to build XBPS with cproc.
2021-02-04 23:09:35 +01:00
Érico Rolim
dc8c8c3868
lib/Makefile: guard -fvisibility=hidden flag. 2021-02-04 23:09:35 +01: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
Érico Rolim
47df729bcc
tree-wide: remove unnecessary __UNCONST usage. 2021-02-04 23:02:39 +01:00
Piotr Wójcik
1e39f21f51
xbps.d.5: describe ignorepkg more precisely
Closes: #370 [via git-merge-pr]
2021-02-04 22:57:50 +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
Duncan Overbruck
93410bee7f
Revert "xbps_init: autodetect musl libc variant at compile time."
This reverts commit 7f75fd840a.
2021-02-04 22:41:21 +01:00
Érico Rolim
6518107579 ci: Add GitHub actions CI. 2020-12-14 16:45:17 +01:00
Érico Rolim
e3b7472b41 build: only try to use git if the command is available. 2020-12-14 16:45:17 +01:00