summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2018-07-02Invalidate id cache after script executionJussi Kukkonen1-0/+4
It's common for a pre-install script to do something like addgroup -S group 2>/dev/null When apk installs files after this, it sets the owner/group based on id cache but currently the id cache is stale and doesn't contain the new group at that point: instead the file will be installed with gid that the build host happened to have for that group -- on target this might mean a non-existing group or a completely different group. We can't know if the script really did modify id cache contents so make sure to reset the id cache on every script execution.
2018-07-02list: fix segmentation fault with virtual packagesSören Tempel1-3/+9
Virtual packages have the origin pointer set to NULL. Trying to print it using the BLOB_PRINTF macros causes a segmentation fault. Inspired by the `print_origin_name` function from `src/search.c` this commit attempts to fix it by checking whether `pkg->origin` is NULL before attempting to print it. If it is NULL the pkg name is printed instead. Since printing the pkg name requires a different format string this commit splits the printf call for printing the package line into multiple ones. The output format shouldn't have changed at all though.
2018-06-14fetch: ignore conflicts when solving --recursive fetchesTimo Teräs3-9/+25
2018-06-14fetch: include install_if dependencies with --recursiveNatanael Copa1-26/+23
Run apk_solver_solve once with all args as dependencies instead of running apk_solver_solve for each arg. This is neccesary so the install_if calculation is done correctly.
2018-05-08url: return relevant error value from apk_istream_fetchEdan Bedrik1-3/+10
2018-04-05db: fix refreshing index if time is zeroTimo Teräs1-3/+5
During netboot on systems without RTC, time() will be near zero, and the index fill not exist. Thus the plain test of st.st_mtime against system time failed. Verify that fstatat() succeeds.
2018-02-21solver: allow names with only one provider to be autoselected regardless of ↵William Pitcock1-2/+3
priority
2018-02-20add: child dependencies can never take a pinning, give a useful errorWilliam Pitcock1-3/+4
2018-02-20apk: in test mode, always exit 0 (so the test harness doesn't stop running ↵William Pitcock1-0/+5
tests)
2018-01-29list: use `apk list --providers` to search virtual providers instead of ↵William Pitcock1-6/+8
enabling virtuals by default
2018-01-29search: remove from APK_COMMAND_GROUP_QUERYWilliam Pitcock1-1/+0
list does everything search does and more
2018-01-29list: add option to match against real names only instead of providersWilliam Pitcock1-1/+7
2018-01-29list: add --depends option for searching based on rdependsWilliam Pitcock1-3/+27
2018-01-29list: refactor package dumping vs package filteringWilliam Pitcock1-20/+20
2018-01-28list: new appletWilliam Pitcock2-1/+236
The list applet provides a convenient way of inspecting both the available and installed package databases by listing their contents. In some ways, it is similar to `apk search` but is considered to be a superset of `apk search` functionality. A few `apk list` criterion are not yet ready though, such as `apk list --depends` which searches by runtime dependency (replacing `apk info --rdepends`).
2018-01-09apk: make --help --verbose actually work.William Pitcock1-1/+10
2018-01-09apk: properly error out if an unknown command is requestedWilliam Pitcock1-1/+5
2018-01-09apk: commit options help text: fix typo concerning diskless bootWilliam Pitcock1-1/+1
2018-01-09apk: usage: cleanup help text when no applet is selectedWilliam Pitcock16-13/+52
2018-01-09fix --update-cache help to reflect realityTimo Teräs1-1/+1
Internally the value is in seconds, but on command line it's in minutes.
2018-01-08auto-update index only when database is opened for writingTimo Teräs2-1/+3
2018-01-04increase libfetch connection pool limits slightlyTimo Teräs1-1/+1
2018-01-04enable automatic update of indexes controlled by --cache-max-ageTimo Teräs9-36/+53
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-03url: add "Cache-Control: no-cache" header with --force-refreshTimo Teräs1-1/+1
fixes #8161
2018-01-03split --force to several --force-[type] optionsTimo Teräs9-24/+60
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 umbrella flag --initramfs-diskless-bootHenrik Riomar1-0/+6
This flag enables a group of options used during initramfs tmpfs initial install.
2018-01-03add new flag --no-commit-hooksHenrik Riomar3-0/+9
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.
2018-01-03db: fix triggers to report deleted directoriesTimo Teräs2-16/+20
This change just changes to keep deleted directory items in the hash with ref count zero and modified flag set. Those entries are reused when needed. The side effect is that fire_triggers() will now see those removed direcotries and reports them. Other enumerators of the directories hash are protected to skip removed directories when appropriate.
2018-01-03apk, del: fix few memory leaksTimo Teräs2-1/+5
This fixes couple of valgrind reported leaks - though they are non-important since the leak happens on "exit" only and kernel frees it anyway.
2018-01-02commit: properly analyze packages with provides="$pkgname"Timo Teräs1-1/+2
2017-12-15fix typo in MIPS byte-order apk_defines.hNils Andreas Svee1-1/+1
2017-12-12solver: fix potential install_if processing failure, fixes #8237Timo Teräs1-46/+49
In discovery phase, there was logic to not process packages multiple times. However, that logic failed to account the package's depth and install_if state for the name being processed. This caused install_if processing failure in certain topologies of the dependency graph. Adds also a test case that should catch this issue reliably.
2017-12-11add detection of mips archsNils Andreas Svee1-0/+8
2017-11-28fetch: print additional error diagnostics in verbose modeTimo Teräs1-2/+5
2017-11-02solver: prefer highest requirer count above installed statusWilliam Pitcock1-5/+5
This ensures a swap is emitted when replacing a virtual with apk add.
2017-11-02solver: fix dbg_printf() call in select_package()William Pitcock1-2/+2
2017-11-02solver: only select a default if there is at least one provider with a ↵William Pitcock1-0/+6
declared provider_priority
2017-11-02solver: instead of tracking selected packages, score by requirer count for ↵William Pitcock2-7/+13
tiebreaking
2017-11-02solver: implement support for choosing default virtualsWilliam Pitcock4-7/+27
By introducing a new package metadata field, `provider_priority` (index letter `k`), we can specify default packages to satisfy a virtual. If a user wishes to select an alternative provider for the virtual, a changeset swapping the default provider for the selected provider will be generated by the dependency resolver.
2017-10-27solver: consider virtual provides to exclude non-provides transitivelyTimo Teräs2-12/+20
this fixes package selection when a 'real' package exists, but would need to be provided by another package with 'virtual provides'. In current package database this can happen with postgresql which is also provided by postgresql-bdr. Normally postgresql would be satisfied by postgresql, but if any package depends on postgresql-bdr and there's no versioned dependency on postgresql this will help apk figure out that postgresql-bdr should be used.
2017-10-12io: fix skip and splice to detect unexpected end-of-fileTimo Teräs2-31/+22
2017-10-10db: handle default root correctly for /procTimo Teräs1-1/+1
dbopts->root may be null; use db->root instead fixes #7162
2017-10-05build and use bundled libfetch nativelyTimo Teräs1-4/+7
2017-10-04package: remove package script after use (fixes #7974)Timo Teräs1-6/+9
this is a regression introduced in commit 349c61c9 ("add support for pre and post commit hooks")
2017-09-27info: fix typo in helpDamiano Albani1-1/+1
2017-08-23commit: proper singular/plural for 'error(s)' in commit messageTimo Teräs1-1/+2
based on github pull request #5
2017-08-23fix comparison of unsigned expression < 0 is always falseDmitry Golovin2-4/+7
found by clang
2017-08-23use labs istead of abs with long argumentDmitry Golovin1-1/+1
2017-07-29index: Only rewrite arch if no error is encounteredA. Wilcox1-2/+2
2017-07-29database: include POSIX header for ST_* definesA. Wilcox1-0/+1