summaryrefslogtreecommitdiff
path: root/src/database.c
AgeCommit message (Collapse)AuthorFilesLines
2023-03-23db, dot, fetch, info, list, search: support --from=FROMSPECTimo Teräs1-2/+3
Allow omitting loading of system installed database and system repositories for the commands that operate on package indexes only.
2023-03-06db, info: sort installed package based data by package nameTimo Teräs1-9/+32
2023-03-06db: case insensitive searchesTimo Teräs1-1/+1
fixes #10871
2023-03-06db, apps: sort packages by pkgname and pkgverTimo Teräs1-17/+121
This will also fix "search" to display one match from each principal pkgname group. "search -e vim" will now show both vim and gvim. fixes #10864 fixes #10777
2023-03-06db, apps: sort display results based on package namesTimo Teräs1-37/+110
2023-02-16io: reset idcache for new passwd/group (and have a root fallback)Daniel Kolesa1-1/+12
In order to address the problem with early file ownership (before passwd/group exists), do a few changes here: 1) For root-owned things, always fall back to fixed values, as those are the ones we always know and cannot change. Since the earliest packages only have root-owned files, this fixes the problem for those. 2) During file migration, if we encounter passwd/group and this is a newly committed file, reset the idcache, similarly to how it is done for scripts. This allows the next package to reload the mappings. Since those two files are usually installed as a part of the first package, the second package onwards should have a valid, complete mapping (reset only by scripts).
2023-01-31cache: fix handling of explict cache at static cache locationTimo Teräs1-3/+11
Omit separate static cache handling step if the explicit cache is configured to the static cache directory. fixes 609fd218 "cache: fix 'clean' to prune static cache always"
2023-01-31cache: fix 'clean' to prune static cache alwaysTimo Teräs1-5/+11
Fix cache applet to prune the static cache which is used for index files if explicit caching is not enabled. fixes #10754
2022-12-28db: handle repository index update/opening errors more consistentlyTimo Teräs1-25/+32
Track separately autoupdate failure, and opening errors. And print only one error per index at maximum. This makes update with or without --no-cache consistent. Ignore errors from local paths as builders often refer to a local path that is being built, but might be non-existent when building the first package. ref #10726
2022-12-22db: always have writable directories with --no-chownDaniel Kolesa1-3/+15
The --no-chown flag is most useful when running apk as a regular user, in which case we want to make sure that there are no issues regarding permissions. Fixes https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10854
2022-12-20db: simplify reverse name list creationTimo Teräs1-12/+12
2022-08-17db: fix change detection for symlinksTimo Teräs1-12/+16
apk_fileinfo_get() special cases symlink digest calculation. Convert apk_fsdir_ops.file_digest to .file_info to fix symlink change detection. fixes #10853
2022-04-05io: move make_dirs as apk_make_dirs and use itTimo Teräs1-12/+3
2022-04-05db: fix atfd for access repository indexTimo Teräs1-2/+3
fixes #10834
2022-03-30keep APK_DEFAULT_ARCH as the define used in source codeAriadne Conill1-1/+1
2022-03-30use arch_prefix for this feature insteadAriadne Conill1-1/+1
2022-03-30use APK_DEFAULT_ABI_TAG everywhere APK_DEFAULT_ARCH was previously usedAriadne Conill1-1/+1
2022-03-29db: make --no-cache disable the cache completelytt-no-cacheTimo Teräs1-4/+11
Including using files found from the cache, or creating the cache directories with --initdb. Based on patch by Paul Spooren.
2022-03-06db: fix APK_OPENF_NO_STATE checkDaniel Kolesa1-1/+1
fixes #10821
2022-03-06db: honor APK_OPENF_NO_STATE againTimo Teräs1-8/+10
Do not call apk_db_read_layer() or try to process the layer if APK_OPENF_NO_STATE is specified. It might fail because of non-existing database directory. Based on patch by Daniel. fixes commit 9e4dd29f "db: prepare database reading for layers" Fixes #10821 Reported-and-analyzed-by: Daniel Kolesa <daniel@octaforge.org>
2022-02-22db, uvol: commit regular files before uvol volumesTimo Teräs1-4/+19
add priority to order fsdir commit sequence
2022-02-22db: fix apkindex path generationTimo Teräs1-1/+1
remove the left over apk_blob_push_fmt() call that corrupted uri and trim the path end from trailing slashes to get original functionality. fixes commit be4ce407 "support new index format without attaching arch"
2022-02-21db: sort world dependencies to layersTimo Teräs1-4/+9
2022-02-21db: prepare database writing for layersTimo Teräs1-135/+172
2022-02-21db: prepare database reading for layersTimo Teräs1-21/+49
2022-02-14support new index format without attaching archPaul Spooren1-8/+20
By default the package architecture is attached to the repository url. With this commit it is possible to define new indexes ending on `.adb`. If such index file is detected the packages must be in the same folder as the index. Signed-off-by: Paul Spooren <mail@aparcar.org>
2022-02-03database: fix apk_db_cache_active returning true when cache not configuredAriadne Conill1-1/+1
this regression was caused by refactoring of the options handling into the apk_ctx struct in 354713d2, presumably a little too much innovation with sed fixes #10799
2022-01-17package: fail on invalid control dataTimo Teräs1-2/+7
Handle meta data error to produce hard failure. fixes #10806
2021-12-29database: refactor mounting and unmounting /procAriadne Conill1-19/+44
2021-12-29database: relocate find_mountpoint()Ariadne Conill1-29/+29
2021-12-29database: refactor cache remountingAriadne Conill1-5/+15
2021-12-29database: refactor tmpfs root detection and cache setupAriadne Conill1-39/+73
2021-12-29database: isolate linux-specific mountpoint headersAriadne Conill1-5/+8
2021-12-29database: use SA_RESETHAND instead of SA_ONESHOT when registering a SIGALRM ↵Ariadne Conill1-1/+1
handler SA_ONESHOT is a GNU-specific alias for POSIX SA_RESETHAND.
2021-12-29use fstatat, not fstatat64Ariadne Conill1-3/+3
the stat64 family of functions were provided as transitional functions, but when building on glibc with _GNU_SOURCE, or any other supported system, the stat functions are equivalent to their stat64 counterparts
2021-12-29apk: add --preserve-env optionPaul Spooren1-2/+2
This options is useful for (post)install scripts to run with the same environment variables as apk is executed. [TT: minor stylistic changes] Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-12-14everywhere: use stdlib.h for malloc(3) definition, not GNU-specific malloc.hAriadne Conill1-1/+0
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-03db: convert v3 scripts to ipkg on installTimo Teräs1-1/+18
fixes #10796
2021-11-22db: synthesize symlink hashes for v3 packagesTimo Teräs1-11/+17
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-22db: fix regression in creating .apk-new filesTimo Teräs1-3/+3
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-15db: lazy create directories with --initdbTimo Teräs1-87/+51
fixes #10778
2021-11-15fix fetching of depdencies only packagesTimo Teräs1-14/+9
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-09database: support loading v3 indexesTimo Teräs1-0/+25
2021-11-09database: implement uvol supportTimo Teräs1-134/+74
by adding an abstraction layer to the file system
2021-11-03db: purge temporary files without explicit modification checkTimo Teräs1-1/+2
When extraction failed, the user has had no opportunity to edit any files. Just clean up.
2021-11-03extract: move uvol extraction code to extractTimo Teräs1-2/+3
fix also the progress callback on uvol extraction
2021-11-03db, extract: handle waitpid returning EINTRTimo Teräs1-1/+1
2021-11-03db, audit: support sha256-160 hashes for v3 pkg compatTimo Teräs1-5/+12
2021-10-27db, add: support adding v3 package filesTimo Teräs1-1/+39
2021-08-23remove IS_ERR_OR_NULLTimo Teräs1-4/+4
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.