Commit Graph

3645 Commits

Author SHA1 Message Date
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
Duncan Overbruck
05ff04a0fb
tests: new test case for updating "unpacked" packages 2020-07-17 00:37:44 +02:00
Alexis
15941299ff xbps.d.5: Multiple changes.
* Mention which keywords can have multiple entries.
* Mention sample configuration file.
* Fix typo.
2020-05-11 14:49:33 +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
9effec0c4e
Move all external code to lib/external. 2020-04-24 12:32:09 +02:00
Juan RP
40d1cf0209
LICENSE.3RDPARTY: fix years for UCB code 2020-04-24 12:16:27 +02:00
Juan RP
f85f6b5232
LICENSE.3RDPARTY: sync 2020-04-24 12:04:13 +02:00
Juan RP
be7d8cfaf1
Use shared LICENSE file for all xbps code. 2020-04-24 11:44:19 +02:00
Juan RP
530e79c7ee
Fix warnings detected by LTO. 2020-04-23 08:32:54 +02:00
Juan RP
e7c1f411ec
configure: bump to 0.60 2020-04-23 07:26:30 +02:00
Juan RP
c488b17ca9
xbps-query.1: new section: PACKAGE MODES.
- Fix mandoc(1) warnings.
- Document --list-repolock-pkgs.
2020-04-23 07:18:57 +02:00
Juan RP
3731f12c91
xbps-install.1: new section: PACKAGE MODES.
Fix mandoc(1) warnings as well.
2020-04-23 07:18:25 +02:00
Juan RP
7d8247ae56
Multiple changes to pkgs on hold mode.
- Added transaction stats for pkgs on hold.

- Always add packages on hold to the transaction dictionary,
  its type will be set to XBPS_TRANS_HOLD.

- Changed xbps_transaction_update_pkg() to have a new "force"
  bool argument to force an update with a pkg on hold.

- As discussed in #274 with @Duncaen the only way to update a
  pkg on hold is by using `-f`, i.e `xbps-install -f foo`.

Closes #265
Closes #274
2020-04-23 06:03:56 +02:00
Juan RP
6b6b394686
lib: keep pkgdb props on updates in the proper place.
Improve f906f5a83d
2020-04-22 12:20:38 +02:00
Duncan Overbruck
7a1f5424f6
tests: add test case for explicit updates with repolock
Introduced from discussion in #273.
2020-04-22 12:18:09 +02:00
Juan RP
f906f5a83d xbps_register_pkg: keep stored props in pkgdb on updates.
I noticed that while updating a pkg that is on hold
or in repolock mode, does not keep those properties.

Always set those props in the new pkg dictionary to respect
this behaviour. If there's a pkg on hold and you update it,
you want to keep it in this state unless you tell it to change.

Added new test case to verify.
2020-04-22 12:00:26 +02:00
Juan RP
9b695433a0
bin: sync usage and keep it consistent in all utils. 2020-04-20 21:25:14 +02:00
Juan RP
d5251a9c23
xbps_init: fix typo in debug output.
For #264
2020-04-20 20:20:29 +02:00
Juan RP
07d8735db6
Makefile: install licenses. 2020-04-20 19:28:59 +02:00
Juan RP
ed3f7b99af
LICENSE.3RDPARTY: mention lib/compat/vasprintf.c. 2020-04-20 19:20:08 +02:00
Juan RP
3453464ba6
LICENSE.3RDPARTY: mention lib/util_path.c and xbps-fbulk. 2020-04-20 19:13:00 +02:00
Juan RP
0b62ba8592
xbps-fbulk: fix usage. 2020-04-20 18:55:44 +02:00
Juan RP
1f4cfc377b
xbps-fbulk: misc changes (v3).
- Re-add original behaviour now I fixed the real issue for missing
  logs. Keep the build/run pipeline full as soon as possible.
- Added -s, --system. System build mode. To only build pkgs that
  are installed manually in your system.
- Added long options; sync usage.
- Restrict max jobs to ncores; there are issues with shared data,
  and until they are resolved this is the only way to make it work
  reliably.
2020-04-20 18:50:11 +02:00
Juan RP
a1d66032bd
xbps-uchroot: support long options; update usage. 2020-04-20 15:12:44 +02:00