aboutsummaryrefslogtreecommitdiffstats
path: root/src/cache.c
Commit message (Collapse)AuthorAgeFilesLines
* apk: usage: cleanup help text when no applet is selectedWilliam Pitcock2018-01-091-0/+1
|
* enable automatic update of indexes controlled by --cache-max-ageTimo Teräs2018-01-041-2/+2
| | | | | | | | | | | | | | | | 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.
* cache: delete more aggressively unneeded cached filesTimo Teräs2014-10-061-4/+10
| | | | | Also if --purge is specified delete all uninstalled packages. Fixes #2889
* applets: unify help message by removing final dotsTimo Teräs2013-06-191-4/+2
|
* print: move progress bar update logic to apk_print_progressNatanael Copa2013-06-191-4/+1
| | | | | | | | | | | | | | | | | | | - 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.
* apk: use string array in applet mains, separate apk_name_foreach_matchingTimo Teräs2013-06-181-6/+7
|
* cache: implement progress bar (ref #1170)Timo Teräs2013-06-171-4/+25
|
* db, cache: do not use cache/tmp for downloadsTimo Teräs2013-06-171-2/+5
| | | | instead use prefix for temporary files.
* db: refactor repository file constructionTimo Teräs2013-06-171-8/+3
| | | | | Fixes also 'fetch' applet to prefer copying/linking to files from cache if possible.
* solver: rewrite as deductive solver -- core featuresTimo Teräs2013-06-131-4/+3
| | | | | Implementing basic dependency handling, install_if and awareness of pinning.
* libapk, apk(8): fix header inclusion issues with musl's headersWilliam Pitcock2013-06-121-0/+1
|
* db: unify handling of special packagesTimo Teräs2013-05-301-2/+2
| | | | | | 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.
* db, io: load repositories also from etc/apk/repositories.d/*.listTimo Teräs2012-02-221-5/+5
| | | | | Load additional repositories from $ROOT/etc/apk/repositories.d/*.list unless --repositories-file is given as parameter.
* db, solver, io: scan cache items at startupTimo Teräs2012-02-221-66/+33
| | | | | | 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.
* cache: fix downloadTimo Teräs2011-10-311-1/+1
|
* all: update copyright year statementTimo Teräs2011-09-131-1/+1
|
* applets: start using solver codeTimo Teräs2011-09-091-17/+8
| | | | | | | | | still todo: - 'fix' is missing - 'del -R' does not work - 'upgrade' does not do self-upgrade first ... and a lot of testing.
* cache: return error if cache sync or download failsTimo Teräs2011-07-111-3/+3
| | | | fixes #666
* db, cache: automatically remount cache read-write when neededTimo Teräs2011-03-161-1/+1
| | | | | | .. and back to read-only after finishing with modifications. fixes #512
* db: handle arch similarly to stable branchTimo Teräs2011-03-161-1/+2
| | | | | if package arch is not set, do not append anything to repository. if arch is set, it is appended to repository.
* db: remove support for unsigned repository indexTimo Teräs2010-12-101-6/+3
| | | | Unsigned indexes should not be needed anymore anyway.
* First steps for libapkNatanael Copa2010-06-111-0/+1
|
* all: rework how arrays workTimo Teräs2010-06-051-4/+1
| | | | | | | | | | Instead of having a null pointer, use a dummy array which just says the array is empty. This helps in multiple places of the code which would otherwise need explicitly need to check first if the array exists. This has been cause of multiple seg.faults in the past as the array check is easily omitted. This also removes (or fixes) all existing checks accordingly.
* cache: do not download files existing in local repositoryTimo Teras2010-03-011-1/+1
| | | | wget:ing local files results in error and is useless.
* db: prefer local repositories, and implement --no-networkTimo Teras2009-08-061-10/+7
| | | | this helps boots sequence when network is not available.
* all: implement database open optionsTimo Teras2009-08-061-13/+6
| | | | so user can override trusted keys directory and repositories file.
* state: fix world dependencies to be honored alwaysTimo Teras2009-08-041-2/+6
| | | | | | previously they might have been skipped on certain situations. this also fixes some other reverse dependency enforcements and implements new "pending" state for locked name.
* apk: use *at instead of chdir+normal file syscallTimo Teras2009-07-311-30/+33
| | | | | | | | this way we never change cwd, and relative filenames are always parsed consistently. this also helps filename construction in many places. this patch also changes '--root' to override location of all configuration to be in the new root. previously it depended on the file which one was used.
* various: misc fixesTimo Teras2009-07-221-3/+4
| | | | | | | - error codes for verification failure types - fix some fdb corruption on file migration - combine some dependency parsing code - fix versioned dependencies
* db: signed index loading (ref #46)Timo Teras2009-07-201-2/+3
| | | | prefer index in the new format as signed .tar.gz.
* cache: make cache cleaning work again properlyTimo Teras2009-07-151-24/+27
|
* db: live with sha1 and md5Timo Teras2009-07-141-11/+12
| | | | this also convers scripts file to a tar archive.
* blob: some helpers to replace snprintfTimo Teras2009-07-141-3/+4
| | | | | snprintf is dog slow. make the blob stuff have some helper functions so we can use them in code paths that are executed often.
* implement --update-cache optionNatanael Copa2009-07-091-0/+1
| | | | This will update the repository cache upon db_open.
* cache: delete also wget temporary filesTimo Teras2009-07-071-2/+10
| | | | | | check for the full filename to match an expected pattern or delete it (so we delete files with .new, .new.backup, etc.). final part of remote package caching: fixes #49.
* cache: use changeset to figure out downloadablesTimo Teras2009-07-071-3/+23
| | | | | that way we get the same result as the 'apk add world' at boot time; it might differ from currently installed set (ref #49).
* db: open flags revisitedTimo Teras2009-07-071-1/+1
| | | | | more fine grained control what to load, and rename some of the flags to be shorter.
* cache: new applet (ref #49)Timo Teras2009-06-291-0/+150
Administrative tool to download or delete files to/from the cache.