Commit Graph
13 Commits
Author SHA1 Message Date
Érico NogueiraandDuncan Overbruck 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 NogueiraandDuncan Overbruck 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
Érico RolimandDuncan Overbruck 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 RolimandDuncan Overbruck d8cf66ce36 xbps-checkvers.1: fix case of -I option.
Closes: #307 [via git-merge-pr]
2021-02-04 23:49:30 +01:00
Érico RolimandDuncan Overbruck 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 RolimandDuncan Overbruck 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 RolimandDuncan Overbruck 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 RolimandDuncan Overbruck 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 RolimandDuncan Overbruck dc8c8c3868 lib/Makefile: guard -fvisibility=hidden flag. 2021-02-04 23:09:35 +01:00
Érico RolimandDuncan Overbruck 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 RolimandDuncan Overbruck 47df729bcc tree-wide: remove unnecessary __UNCONST usage. 2021-02-04 23:02:39 +01:00
Érico RolimandDuncan Overbruck 6518107579 ci: Add GitHub actions CI. 2020-12-14 16:45:17 +01:00
Érico RolimandDuncan Overbruck e3b7472b41 build: only try to use git if the command is available. 2020-12-14 16:45:17 +01:00