summaryrefslogtreecommitdiff
path: root/src/commit.c
AgeCommit message (Collapse)AuthorFilesLines
2023-02-14commit: sort package lists displayed before commitTimo Teräs1-13/+27
Sort the changes by package name before displaying each package listing for easier reading by user. fixes #10866
2022-12-22commit: consider also provides_priority for error analysisTimo Teräs1-1/+2
2022-12-20solver, commit: handle install_if via provided names correctlyTimo Teräs1-21/+59
Correctly trigger install_ifs for provided names also. And fix the construction of error messages concerning such install_if packages. ref #10843
2022-12-20apk: improve interactive mode handlingTimo Teräs1-1/+1
- implement and document --no-interactive - improve --interactive documentation - treat EOF as Y fixes #10860
2022-12-20commit: correctly analyze virtual provides induced errorsTimo Teräs1-15/+51
The package list cannot be used to determine name state, as packages are not selected through all of their names, and that effects the status of unversioned provides. Thus the name state must be calculated in separate step via the dependency graphs. ref #10847
2022-02-24solver: do not auto select virtual-only package with one providerTimo Teräs1-0/+4
This reverts most of 0dcbd933 which allowed automatic selection of package with a "virtual provides" having only one provider. While convenient, it creates problems if multiple versions of the same package exist, or if in future other providers would be added to one of the repositories. This restore the original behaviour, and improve the error message to tell the user to mention one of the providers explicitly. fixes #10810
2021-12-14commit: print download size of packages in interactive modeTimo Teräs1-3/+12
ref #10788
2021-12-14fix fetching of depdencies only packagesTimo Teräs1-1/+1
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.
2020-10-07various changes to make clang not give warningsTimo Teräs1-0/+2
2020-10-03commit: rephrase the error messages more understandableTimo Teräs1-2/+2
fixes #10703
2020-05-19make the atom functions not use global stateTimo Teräs1-2/+2
This greatly helps with memory management on applications that may want to daemonize and open/close database several times. Also the lifetime and "owner" of memory for all data is now explicitly bound to owning struct apk_database, which might be helpful when writing language bindings. As side effect, the interned "atoms" are unique only within what apk_database, so comparing packages from different apk_database may not work as expected. Fixes #10697
2020-05-07use SPDX-License-Identifier in source filesTBK1-3/+1
2020-01-05commit: make use of the apk_get_human_unit functionSören Tempel1-11/+8
2018-11-02don't report virtual packages as maskedTimo Teräs1-1/+1
2018-11-02inhibit printing same 'required by' dependency multiple timesTimo Teräs1-0/+5
this would happen if same package matched multiple times due to multiple provided names.
2018-09-10rework unpacking of packages and harden package file format requirementsTimo Teräs1-2/+2
A crafted .apk file could to trick apk writing unverified data to an unexpected file during temporary file creation due to bugs in handling long link target name and the way a regular file is extracted. Several hardening steps are implemented to avoid this: - the temporary file is now always first unlinked (apk thus reserved all filenames .apk.* to be it's working files) - the temporary file is after that created with O_EXCL to avoid races - the temporary file is no longer directly the archive entry name and thus directly controlled by potentially untrusted data - long file names and link target names are now rejected - hard link targets are now more rigorously checked - various additional checks added for the extraction process to error out early in case of malformed (or old legacy) file Reported-by: Max Justicz <max@justi.cz>
2018-01-03split --force to several --force-[type] optionsTimo Teräs1-2/+4
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/+4
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-02commit: properly analyze packages with provides="$pkgname"Timo Teräs1-1/+2
2017-08-23commit: proper singular/plural for 'error(s)' in commit messageTimo Teräs1-1/+2
based on github pull request #5
2017-08-23use labs istead of abs with long argumentDmitry Golovin1-1/+1
2017-03-06commit: include limits.h for PATH_MAXNatanael Copa1-0/+1
this fixes build on ppc64le
2017-02-27commit: fix to work if commit_hook.d directory does not existTimo Teräs1-2/+2
2017-02-16commit: log parameter passed to a hook scriptHenrik Riomar1-1/+1
2017-02-15add support for pre and post commit hooksHenrik Riomar1-1/+38
This allows for instance integration of etckeeper [TT: Reorganized code a bit, and modified to use single directory commit_hooks.d with argument for script of stage.]
2016-07-22upgrade: improve self upgrade functionality a bitTimo Teräs1-1/+1
trigger it only if apk-tools can be upgrade, add test cases
2015-12-10commit: self-conflict error and satisfies printingTimo Teräs1-5/+13
- self-conflicts when the exact same version of a name is provided twice is now properly detected and diagnozed - don't print redundant satisfies diagnostic
2015-04-07commit: return failure if there are any errorsNatanael Copa1-1/+1
fixes #4019
2014-10-07db: rework directory permission handlingTimo Teräs1-0/+1
Apk used to reset directory permissions always, but this is undesirable if user has modified the permissions - especially during tmpfs boot. Though, it is desirable to update the permissions when packaging has changed permissions, or a new package is installed and the merged permission mask / owner changes. Thus the new code updates the permissions only if: 1) We are booting and directory is not in apkovl 2) The directory is modified by a package install/remove/upgrade 3) The filesystem directory permission matched database Additionally "apk fix --directory-permissions" can be used to reset all directory permissions to the database defaults. Fixes #2966
2014-05-19solver: fix installation of non-repository packages during tmpfs bootTimo Teräs1-0/+3
allow packages in the cache's installed to be selected for installation by the solver. add test case for the issue.
2013-08-05commit: fix segfaultNatanael Copa1-1/+1
apk would try run the trigger even if package failed to install.
2013-08-03commit: don't ask questions if simulatingTimo Teräs1-9/+9
2013-06-21commit: fix another re-installing misspelling to reinstallingTimo Teräs1-1/+1
2013-06-20commit: fix ssize_t printingTimo Teräs1-4/+5
2013-06-20commit, db: make file conflicts and script errors non-fatalTimo Teräs1-19/+33
fixes #1482
2013-06-19solver: fix package deletion to consier provides properlyTimo Teräs1-3/+2
2013-06-19all: few behavioural regression fixesTimo Teräs1-1/+1
Wildcard matching with no names should match all packages only for info and search applet. "apk del" would otherwise try to delete everything, etc. Fix also interactive mode to ask questions only if we are actually changing something.
2013-06-19print: move progress bar update logic to apk_print_progressNatanael Copa1-14/+5
- let the apk_print functions deal with the forced print itself. We avoid that the callbacks need to deal with the force flag. We can also get rid of the APK_PRINT_PROGRESS_* defines. - let the reader of --progress-fd decide how often things are updated rather than having a fixed granularity off 1/100 (percent) - avoid detect screen size and percent/bar calculations in case the --no-progress was given - track satistics for both the ascii bar and percent info and update bar only if either percent or bar changes. This makes the bar go smoother when width is wider than 100 chars and it makes the percent counter go smooth when screen width is less thann 100 chars. It also simplifies the callbacks as they no longer need to deal with update granularity.
2013-06-19upgrade: new option: --latest (-l)Timo Teräs1-6/+11
Select latest version of package (if it is not pinned), and print error if it cannot be installed due to other dependencies. Together with --available, it selects the latest package which is present at least in some repository. This also fixes few solver issues with ordering of package selection that got quite apparent with this flag. Namely, we cannot "lock" a package until it's reverse dependencies are locked or not all of the solver flags are propagated properly.
2013-06-18errors: fix a test case, and misanalysis of certain namesTimo Teräs1-0/+2
the pinning11 changed when @repo got the leading @ on error messages. analyze_dep() now properly ignores conflict dependencies, as those names are usually intentionally left unassigned.
2013-06-18db: store repository tag names including leading @Timo Teräs1-17/+10
2013-06-18errors: improve analysis for virtual packagesTimo Teräs1-11/+24
if all packages named N provide the virtual package, list only the name N instead of all packages providing it.
2013-06-18all: various conversions to foreach_array_item, and simplifications of codeTimo Teräs1-15/+9
2013-06-17io: get rid of APK_PROGRESS_SCALETimo Teräs1-5/+3
no need to muldiv all the time, just pass the current amount of bytes done, and let callbacks use that directly.
2013-06-17cache: implement progress bar (ref #1170)Timo Teräs1-3/+4
2013-06-17print: move progress printing to common functionsTimo Teräs1-34/+4
2013-06-14errors: detect self-conflicts properlyTimo Teräs1-4/+6
and add the provided version information to the conflicts. fixes the final test case that was broken. hooray.
2013-06-13solver, errors: fix few additional test cases and clean upsTimo Teräs1-2/+2
2013-06-13pkg: add global reverse dependency iterator helpers and use themTimo Teräs1-58/+10
... in the error printing and the package deletion.
2013-06-13errors: rewrite the logic how errors are reportedTimo Teräs1-102/+255
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.