summaryrefslogtreecommitdiff
path: root/src/apk_defines.h
AgeCommit message (Collapse)AuthorFilesLines
2021-12-14defines: provide APKE_REMOTE_IO as portable alternative to EREMOTEIOAriadne Conill1-0/+1
2021-12-14applet: rework APK_DEFINE_APPLET to use constructor attributeAriadne Conill1-0/+1
this allows the applet registration to work in a portable way, without having to weird things with the linker. ref #10794
2021-11-09database: implement uvol supportTimo Teräs1-1/+3
by adding an abstraction layer to the file system
2021-08-23mkpkg: add support for scripts and triggersTimo Teräs1-1/+1
2021-08-23remove IS_ERR_OR_NULLTimo Teräs1-1/+0
In most places where pointer can be an 'error' it cannot be null pointer. Further, in those cases just calling PTR_ERR() is not enough to handle the null case. Simplify code by removing this case. If NULL case needs to be handled, it's better to add separate check and return fixed error code in that case.
2021-07-27Refactor .apk extraction codeTimo Teräs1-0/+1
This moves and isolates the tar code to tar.c. And the actual file extraction to disk is moved to extract.c. A new API is introduced and used for v2 file extraction. This essentially moves and isolates the apk_sign_ctx_* beast into extract_v2.c and offers a saner interface to handling packages. A place holder is added for v3 extraction.
2021-07-25io_archive: Use SOURCE_DATE_EPOCH for meta files instead of current timekpcyrd1-0/+2
[TT: minor stylistic changes]
2021-07-23db: allow read-only operations without cacheTimo Teräs1-1/+2
fixes #10748
2021-07-22adb: add a small adb blob header with versions and root objectTimo Teräs1-0/+1
2021-07-22adb: support seamless de/compression of adb filesTimo Teräs1-0/+1
Add compression header of adb files. Support uncompressed and deflate compression at this time.
2021-07-06define APK_DEFAULT_ARCH for loongarch targetsAriadne Conill1-0/+6
Macros used have been taken from Loongson's work-in-progress GCC 12 port.
2021-06-19reduce misuse of error codes from errno.hTimo Teräs1-5/+28
2021-06-11mkpkg: new applet to create v2 packages with basic functionalityTimo Teräs1-4/+4
2021-02-04db: consider control characters in filename as maliciousTimo Teräs1-0/+1
Especially a newline can produce havoc in the database file as the filename is written there as-is. This hardenes the extraction to consider any control character as malicious. Additional hardening is added to database loading to better detect corrupt state and return proper error code about it. Reported-by: Luca Weiss <luca@z3ntu.xyz>
2020-10-09rename apk_db_options to apk_ctx, rework loggingTimo Teräs1-3/+0
makes apk_verbosity non-global fixes #10682
2020-10-09make apk_flags non-global, make progress printing state non-globalTimo Teräs1-14/+0
ref #10682
2020-10-09make apk_force non-global, remove left-over apk_archTimo Teräs1-9/+1
ref #10682
2020-10-09adb: introduce apk-tools database format, and few appletsTimo Teräs1-0/+5
This is a flat buffers inspired format that allows fast mmaped access to the data with low overhead, signature support and relatively good forward support.
2020-05-17define APK_DEFAULT_ARCH for riscv32 and riscv64 targetsAriadne Conill1-0/+4
2020-05-07use SPDX-License-Identifier in source filesTBK1-3/+1
2020-03-21fix glibc buildTBK1-0/+1
fixes #10677 src/apk_defines.h:152:15: error: unknown type name 'uint32_t' static inline uint32_t get_unaligned32(const void *ptr) ^~~~~~~~
2020-02-21db: fix unaligned memory access in csum_hash()Timo Teräs1-0/+10
2020-02-04defines: add typeof() as it's gcc built-inTimo Teräs1-0/+4
Related to MR !15
2020-02-04remove apk_time() as it is causing problems with shared objectsTimo Teräs1-2/+0
Instead, to make sure test mode produces same output, redefine time() for the test mode binary. Reverts parts of 0b82bcc53e60.
2019-06-03use fixed system time in test mode to have fixed test outputTimo Teräs1-0/+3
fixes test suite regression from previous commit
2018-01-04enable automatic update of indexes controlled by --cache-max-ageTimo Teräs1-1/+0
This modifies apk cache for indexes to be automatically refreshed periodically without explicit 'update' or '--update-cache' usage. The default is to do if-modified-since request if the local copy is older than 4 hours. This age can be changed with --cache-max-age. Using --update-cache will change this age to 60 seconds to make sure the cached copy is relatively new. The small age is in order to try to avoid downloading indexes second time when apk-tools is upgraded and apk re-execs after self-upgrade. Accordingly using explicitly 'apk update' will now enforce --force-refresh and request the very latest index by requesting any potential http proxy to do refresh too.
2018-01-03split --force to several --force-[type] optionsTimo Teräs1-2/+8
This unloads --force as several of the things are really not wanted together. E.g. --force-refresh is a lot different from --force-broken-world and doing --force to get the other might introduce unwanted behaviour. --force is still kept for backwards compatibility and it enables most things --force was used for.
2018-01-03add new flag --no-commit-hooksHenrik Riomar1-0/+1
This flag skips running hook scripts This flag *must* be used during initramfs tmpfs initial install. The reason that this new flag is needed is that the hooks will currently always fail as musl and /bin/sh is missing at this stage on diskless.
2017-12-15fix typo in MIPS byte-order apk_defines.hNils Andreas Svee1-1/+1
2017-12-11add detection of mips archsNils Andreas Svee1-0/+8
2017-06-01apk_defines: implement mulmod()William Pitcock1-0/+8
2017-01-17Add ppc64le entry in apk defines.Breno Leitao1-1/+3
Currently apk only knows about powerpc and ppc64. I am adding support for ppc64le. ppc64le is the based on the ABI v2, which defines the endianess as little, while ppc64 is based on the first 64-bits ABI.
2016-11-21add s390x headersTuan M. Hoang1-0/+2
2016-07-08detect aarch64 architecture and assign default name for itTimo Teräs1-2/+3
2015-12-07db: add support for --no-cacheNatanael Copa1-0/+1
Implement --no-cache. The index is read directly from network and not cached. This is useful for docker, where you install a set of packages and directly after purge the cache. (see https://github.com/gliderlabs/docker-alpine/blob/1fc9e59d1689fc4eaf930ec66389fe58062fccec/builder/scripts/apk-install) fixes #4905
2015-11-12add armv7 targetTimo Teräs1-0/+2
2015-04-24modifications for the previous commit in error message handlingTimo Teräs1-1/+2
forgot to --amend my changes
2015-04-22print.c: provide more detailed error messages if retrieving a package failsAlex Dowad1-0/+2
fetch_maperror() translates error codes returned by libfetch to our error codes. Handle those in apk_error_str(), returning error messages which advise the user of the most likely fix. A custom error code, EAPKSTALEINDEX, has been added for cases where retrieving a package fails due to a HTTP error 404 or similar. [TimoT: add also EAPKBADURL, as well as organize a bit better where the EAPKSTALEINDEX is generated]
2014-10-08io,url,db: support for if-modified-sinceTimo Teräs1-0/+6
2013-09-10apk: new option --no-scriptsTimo Teräs1-0/+1
to not run any per-package scripts. useful for managing buildroot when cross-compiling.
2013-09-05arch: use armhf for arm hardfloat eabiTimo Teräs1-2/+2
at least debian and musl do this, so let's go along with that.
2013-07-02defines: detect endianess on arm, for armelTimo Teräs1-0/+3
2013-06-17io: get rid of APK_PROGRESS_SCALETimo Teräs1-2/+1
no need to muldiv all the time, just pass the current amount of bytes done, and let callbacks use that directly.
2013-06-13errors: rewrite the logic how errors are reportedTimo Teräs1-0/+3
Instead of the dependency oriented logic, switch to print them for each package or name needed. Might give a bit more readable errors now. There's still few corner cases that proper error is not output, which are cought by the test cases.
2013-06-13solver: rewrite as deductive solver -- core featuresTimo Teräs1-3/+20
Implementing basic dependency handling, install_if and awareness of pinning.
2013-05-30db: unify handling of special packagesTimo Teräs1-1/+1
make cache a special kind of repository, and automatically cache special packages (virtual packages, or ones installed from command line). add test cases for handling virtual packages. fixes #1617.
2012-02-22db, solver, io: scan cache items at startupTimo Teräs1-0/+20
It is faster to just scan the cache directory for existing packages at startup than trying to faccessat() them on demand. It also makes quite a few parts of the code more readable and simpler.
2012-02-20solver: rewrite backtracking and scoring systemTimo Teräs1-0/+5
* properly do absolute scoring now, the previous scoring where preference could get reduced could have caused incorrect early pruning of search tree * backtracking is now separated from package state, and first branching point is the decision if a name is left unassigned or if something _has_ to be assigned. this allows multiple future search tree optimizations like handling of common dependencies early. * merge common dependency names early to provide deeper forward checking.
2012-01-06common: fix apk_array copying, and additional size_t fixesTimo Teräs1-0/+1
2011-09-20all: fix array size data type on 64 bitNatanael Copa1-1/+1
The array struct aligned size to 64 bit on x86_64 which caused bad things to happen. We use size_t to make sure the size element is correct regardless arch. Solution found by Timo.