Timo Teräs
0baf59627b
io: fix tee error handling path
...
Make sure the from is not dereferenced/used on error path, and
cancel the ostream.
fixes #10800
2021-12-27 10:20:03 +02:00
Daniel Golle
4ccf038a9f
add option --no-logfile
2021-12-23 08:07:42 +00:00
Paul Spooren
af489f3b6f
io.c: add missing limits.h
...
Fixes compilation on MacOS X
2021-12-20 12:01:41 +00:00
Kevin Daudt
e3b499fb2b
ci: strip static binary
...
To reduce the file size, strip the static binary.
2021-12-18 20:19:38 +01:00
Kevin Daudt
f49600d38b
ci: use arch-tagged images for static build
...
For 32-bits arches, we use 64-bit arches in 32-bit mode. Docker by
default wants to pull the image for the native arch, so unless we take
care, the binaries will be built for the wrong arch.
Use the arch tagged images we build to make sure we get the correct image.
2021-12-18 20:10:12 +01:00
Jan Hendrik Farr
0f50f9ff29
libfetch: Allow special characters in http basic auth
...
Currently, special characters in the username or password are not
handled correctly (when set in $http_proxy and $https_proxy). They
should be percent encoded in the environment variables then decoded
by libfetch and reencoded using base64. This implementation is mainly
taken from the current FreeBSD source and adapted to the apk-tools
version of libfetch.
fixes #10775
2021-12-17 10:11:11 +02:00
Ariadne Conill
6941f8bd61
adb: use sys/uio.h for iovec operations
...
readv/writev and struct iovec are declared in sys/uio.h per POSIX.
using it without sys/uio.h is a GNU extension.
ref #10794
2021-12-14 13:06:26 -06:00
Ariadne Conill
36fcbeed1a
applet: suppress is_error warning on clang
...
clang does not ignore inline functions when checking for unused functions
ref #10794
2021-12-14 18:54:16 +00:00
Ariadne Conill
5bd3b1e3fc
uvol: cast size data to intmax_t
...
this ensures the %ju format parameter is always passed an integer that is
appropriately sized, e.g. on mac where off_t is normally 32-bit.
ref #10794
2021-12-14 18:49:11 +00:00
Ariadne Conill
6df9f0ed59
defines: provide APKE_REMOTE_IO as portable alternative to EREMOTEIO
2021-12-14 18:48:18 +00:00
Ariadne Conill
46a2049d46
meson: fix underlinking issue with lua module
2021-12-14 18:46:18 +00:00
Ariadne Conill
2ac0a72430
libfetch: use static_deps when compiling libfetch under meson
2021-12-14 18:46:18 +00:00
Ariadne Conill
3fd120db5c
applet: rework APK_DEFINE_APPLET to use constructor attribute
...
this allows the applet registration to work in a portable way, without having to
weird things with the linker.
ref #10794
2021-12-14 12:05:59 -06:00
Kevin Daudt
980e58efc6
ci: create release from tags
2021-12-14 16:33:24 +00:00
Kevin Daudt
ada3314220
ci: add job to build static binary
2021-12-14 16:33:24 +00:00
Ariadne Conill
81d8d2b3f4
libfetch: use pkg-config to find openssl cflags
...
on mac, openssl is usually provided by Homebrew or some other third-party
package management system, which means pkg-config is needed to find it.
we already use pkg-config to find openssl when building apk itself.
ref #10794
2021-12-14 16:24:25 +00:00
Ariadne Conill
f4f7796ccc
everywhere: use stdlib.h for malloc(3) definition, not GNU-specific malloc.h
...
musl implements support for malloc.h, but it is only a stub. we do not use
any of the GNU-specific malloc interfaces, so just use POSIX stdlib.h instead.
ref #10794
2021-12-14 16:23:29 +00:00
Ariadne Conill
b2d3d63184
lua: remove features.h
...
features.h is a GNU-specific header, and is not required for POSIX-compatible code
macOS does not provide features.h
ref #10794
2021-12-13 14:44:21 -06:00
Ariadne Conill
4846c498c7
libfetch: avoid use of strdupa GNU extension
...
ref #10794
2021-12-09 10:34:31 -06:00
Timo Teräs
8c6c44d3eb
extract_v3: make sure empty file's hash is copied too
...
fixes #10785
2021-12-03 15:06:49 +02:00
Timo Teräs
1ab81fdd4c
db: convert v3 scripts to ipkg on install
...
fixes #10796
2021-12-03 14:53:30 +02:00
Timo Teräs
4dde7e7e0f
extract: fix uvol to not be called for uvol directory
2021-12-02 18:04:43 +02:00
Timo Teräs
845fa93814
db: synthesize symlink hashes for v3 packages
...
The v3 format will not require the hash, but synthesize it to the
DB so v3 packages can get installed properly.
fixes #10785
2021-11-22 13:41:22 +02:00
Timo Teräs
cce6239074
db: fix regression in creating .apk-new files
...
The apk_fsdir_file_digest() servers dual purpose: to calculate
the checksum, but also to determine if the file exists. Move
it's error check where it originally was.
fixes #10791
2021-11-22 10:35:18 +02:00
Timo Teräs
83b71f0baf
db: lazy create directories with --initdb
...
fixes #10778
2021-11-15 15:56:48 +02:00
Timo Teräs
061bd69b80
fs_fsys: fix extraction of symlinks
...
Symlinks should use the real target filename instead of
the temporary extraction name.
2021-11-15 15:55:15 +02:00
Timo Teräs
de281f0f83
extract_v2: handle "untrusted package" as normal error
...
The "untrusted" error is higher priority than malformed package.
But given that we expect valid .apk or index as argument, the
untrusted error is likely more accurate than having malformed
package.
2021-11-15 15:41:59 +02:00
Timo Teräs
25c152e653
commit: print download size of packages in interactive mode
...
ref #10788
2021-11-15 14:37:25 +02:00
Timo Teräs
16e0f6df7f
fix fetching of depdencies only packages
...
Remove the APK_REPOSITORY_CACHED bit from dependencies only
packages (that is, installed_size == 0). For fetch, the problem
is that apk_db_select_repo() would return the cache repository,
but the package would not be there. Update also the locations
needed to handle these packages correctly without the cached
repository bit being set.
2021-11-15 13:35:59 +02:00
Timo Teräs
3cb5ce2a37
fetch: add --url option to print the download URLs
2021-11-12 13:10:31 +02:00
Timo Teräs
3e6261392f
pkg: fix reading of v3 package meta data
...
The adb object for apk_pkg_from_adb() was changed in commit 7d6de220
"database: support loading v3 indexes" which also addressed the broken
site in question but omitted updating the argument.
fixes #10783
2021-11-11 11:41:29 +02:00
Timo Teräs
97e3647e1d
pathbuilder: fix push return value
...
Always return the original length; not the one with trailing '/'
amended.
fixes c60b7424
"optimize apk_pathbuilder_pop to get the old length"
ref #10784
2021-11-11 11:24:49 +02:00
Timo Teräs
9d7b4bd253
extract_v3: fix extraction of zero length files
...
The apk_istream is null for zero length files, and needs
special handling.
fixes #10784
2021-11-11 11:22:06 +02:00
Timo Teräs
c60b7424a0
optimize apk_pathbuilder_pop to get the old length
...
avoids memrchr
2021-11-09 21:50:11 +02:00
Timo Teräs
7c8f872572
adbdump: fix dumping signatures
...
give a fake trust root allowing anything. adbdump code will verify
and dump each signature individually.
2021-11-09 21:50:11 +02:00
Timo Teräs
7d6de2203e
database: support loading v3 indexes
2021-11-09 21:50:11 +02:00
Timo Teräs
a673653200
database: implement uvol support
...
by adding an abstraction layer to the file system
2021-11-09 21:50:11 +02:00
Timo Teräs
d441cf523c
db: purge temporary files without explicit modification check
...
When extraction failed, the user has had no opportunity to edit
any files. Just clean up.
2021-11-03 16:06:04 +02:00
Timo Teräs
5c0c249b78
extract: move uvol extraction code to extract
...
fix also the progress callback on uvol extraction
2021-11-03 15:37:10 +02:00
Timo Teräs
d821265865
db, extract: handle waitpid returning EINTR
2021-11-03 15:37:10 +02:00
Timo Teräs
6941aac4c6
db, audit: support sha256-160 hashes for v3 pkg compat
2021-11-03 15:37:10 +02:00
Timo Teräs
40f0866367
db, add: support adding v3 package files
2021-10-27 16:14:45 +03:00
Timo Teräs
9bd1e95e5b
mkpkg: make unique-id field a blob
2021-10-25 15:48:59 +03:00
Timo Teräs
50ab589e9a
version: increase number of digits supported in version component
...
Report also version numbers as invalid if there's more than 18
digits.
fixes #10774
2021-10-25 13:30:40 +03:00
Timo Teräs
d38e2dd65a
enable uvol support by default
2021-10-04 15:05:38 +03:00
Timo Teräs
9f07a3447e
adb: fix --allow-untrusted to work again
...
and fix the error code if untrusted adb is seen
2021-09-13 13:18:17 +03:00
Alex Xu (Hello71)
a278d11287
test: improve posix sh compatibility
2021-09-03 15:02:12 +03:00
Timo Teräs
984cd3e0b6
extract: remove redundant file unlink on failure path
...
apk_extract_file() already calls unlink if the error is fatal.
2021-09-03 13:47:04 +03:00
Timo Teräs
fd42c073bf
extract: pass root object instead of database
2021-09-03 13:44:48 +03:00
Alex Xu (Hello71)
bd15683670
add: warn when creating empty virtual packages
...
see https://gitlab.alpinelinux.org/alpine/aports/-/issues/11736
[TT: minor stylistic change]
2021-09-03 13:24:39 +03:00