aboutsummaryrefslogtreecommitdiffstats
path: root/src/database.c
Commit message (Collapse)AuthorAgeFilesLines
...
* db: fix crash if unable to download cache itemTimo Teräs2014-10-071-2/+3
| | | | fixes #3371
* db: rework directory permission handlingTimo Teräs2014-10-071-54/+79
| | | | | | | | | | | | | | | | | | 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
* db: use per-pkg architecture (if available) to form download urlTimo Teräs2014-10-061-2/+6
| | | | | | | Allows one arch index files to refer to other arch packages. Mostly useful with noarch packages, but could be used e.g. to ship build with some of packages optimized for specific cpu generation and share most packages with the standard build.
* index: fix warning about package names without providerTimo Teräs2014-10-061-0/+1
| | | | | It's real only if there's a package with actual dependency (conflicts and install_if dependencies do not count).
* solver: fix installation of non-repository packages during tmpfs bootTimo Teräs2014-05-191-0/+2
| | | | | allow packages in the cache's installed to be selected for installation by the solver. add test case for the issue.
* db: allow replacing files of origin package is sameTimo Teräs2014-04-251-0/+3
| | | | | | basically this makes packager's life simpler as there is no need to list the subpkg names in replaces. this was also very error prone and tedious job to do properly.
* audit: include all files in etc/apk in overlayTimo Teräs2014-03-121-27/+23
| | | | | | | | | This implements a new protected path flag '!' to include always matching entries in the backup mode (overlay). This is also turned on for etc/apk to include everything there in overlay, because the full list of repositories and signing keys need to be in overlay - just getting them from a package is not enough during bootstrap.
* db: allow using cached packages with --no-networkTimo Teräs2013-10-021-1/+1
|
* db, url: fix exec sentinelsTimo Teräs2013-10-011-1/+1
| | | | http://ewontfix.com/11/
* db: minor improvements to an error and a verbose log messagesTimo Teräs2013-09-201-2/+2
|
* db: fix error messageTimo Teräs2013-09-201-1/+1
|
* db: fix segfault when --root points to invalid dirNatanael Copa2013-07-171-1/+3
| | | | fixes #2134
* various: applet help text and comment fixesDubiousjim2013-06-281-8/+6
| | | | Acked-by: Natanael Copa <ncopa@alpinelinux.org>
* db: write ipkg flags in proper placeTimo Teräs2013-06-211-7/+8
|
* db: reset broken pkg state on reinstallTimo Teräs2013-06-211-0/+2
|
* solver: fix pinning+cache to workTimo Teräs2013-06-201-2/+0
| | | | | Mistakenly allowed masked out package to be installed if it was in cache.
* commit, db: make file conflicts and script errors non-fatalTimo Teräs2013-06-201-82/+67
| | | | fixes #1482
* all: few behavioural regression fixesTimo Teräs2013-06-191-0/+2
| | | | | | | | | 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.
* policy: new appletTimo Teräs2013-06-181-4/+4
| | | | | to show different versions of package and the repositories from which it is available from.
* db: store repository tag names including leading @Timo Teräs2013-06-181-21/+35
|
* apk: use string array in applet mains, separate apk_name_foreach_matchingTimo Teräs2013-06-181-0/+77
|
* all: various conversions to foreach_array_item, and simplifications of codeTimo Teräs2013-06-181-33/+25
|
* io: get rid of APK_PROGRESS_SCALETimo Teräs2013-06-171-19/+4
| | | | | no need to muldiv all the time, just pass the current amount of bytes done, and let callbacks use that directly.
* cache: implement progress bar (ref #1170)Timo Teräs2013-06-171-5/+9
|
* print: move progress printing to common functionsTimo Teräs2013-06-171-1/+0
|
* db, cache: do not use cache/tmp for downloadsTimo Teräs2013-06-171-22/+22
| | | | instead use prefix for temporary files.
* db: refactor repository file constructionTimo Teräs2013-06-171-107/+129
| | | | | Fixes also 'fetch' applet to prefer copying/linking to files from cache if possible.
* solver, errors: fix few additional test cases and clean upsTimo Teräs2013-06-131-12/+12
|
* solver: rewrite as deductive solver -- core featuresTimo Teräs2013-06-131-13/+19
| | | | | Implementing basic dependency handling, install_if and awareness of pinning.
* index: add sensible error message if metadata is too longTimo Teräs2013-05-301-4/+4
| | | | | | | | | | | fixes #1476 Instead of: ERROR: Index generation failed: Success The following is now printed: ERROR: Metadata for package timo-1.0-r0 is too long. ERROR: Index generation failed: No buffer space available
* db: unify handling of special packagesTimo Teräs2013-05-301-56/+55
| | | | | | 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, info: allow packages to install files/symlinks to rootTimo Teräs2013-05-291-20/+40
| | | | fixes #1578
* db: make dev/null a character device with --initdbTimo Teräs2013-05-291-1/+1
| | | | fixes #1714
* apk: implement --progress-fd to write progress to a specified fdTimo Teräs2012-09-201-0/+1
|
* db: remove AT_SYMLINK_NOFOLLOW for directory permissionsTimo Teräs2012-09-041-2/+2
| | | | | | | | | | | fchmodat does not support this flag - symlinks do not have permissions. Sysadmin probably does not expect us to not follow symlinks either: if /var -> /mnt/foo/var, we should be making sure the permissions and ownership is correct on the target directory, not on the symlink. Since fchmodat never returned ENOENT with AT_SYMLINK_NOFOLLOW, this also fixes directory re-creation if it does not exist. fixes #1348.
* audit: fix protection mask of non-db directoriesTimo Teräs2012-07-161-3/+2
| | | | | | | | | If a directory has protection mask, but does not exist in db, we do not handle it right unless we calculate the protection mask by hand, or create temporary db dir entry for it. For simplicity create always the db dir entry -- depending on audit type we likely need to create it anyway. This commit also caches the db dir entry in the audit tree context to avoid duplicate lookups. ref #1241.
* db: strip leading and trailing slashes from protected path specTimo Teräs2012-05-011-0/+6
|
* db: fix has_protected_children setup on leaf path entriesTimo Teräs2012-04-271-1/+1
| | | | Fixes --recurse during audit.
* solver, dot: elementary provides fixesTimo Teräs2012-02-241-2/+11
| | | | | | implementation is still not near finished, but now at least it can handle it to a minimum degree. many cases are not done right yet, though. ref #574.
* all: introduce apk_provides and use it in apk_nameTimo Teräs2012-02-241-7/+12
| | | | | | | in preparation for provides support. implements also some dependency satisfaction helper routines. ref #574.
* pkg, db: use 's' for source repository tags instead of 'p'Timo Teräs2012-02-241-1/+2
| | | | Will use 'p' for provides.
* db: keep architecture in $ROOT/etc/apk/archTimo Teräs2012-02-231-6/+19
| | | | This we use proper arch in case modifying chroot installation.
* audit, db: add etc/apk/protected_files.d and new audit featuresTimo Teräs2012-02-231-46/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | fixes #607. audit is now mostly rewritten for the new functionality. And has new features like --check-permissions, --recursive and --packages. $ROOT/etc/apk/protected_files.d/*.list can now contain additional protected paths, one path per line: +etc @etc/init.d -tmp + will include the directory as protected configuration directory. @ considers the directory protected, but will backup only symlinks. - removes any protection lbu should be modified to put include and exclude paths in etc/apk/protected_files.d/lbu.list. Additionally, some packages might provide their own listings. E.g. ssh might want to provide ssh.list with something like: +root/.ssh +home/*/.ssh
* db: fix repositories.d to be loaded only without --repositories-fileTimo Teräs2012-02-221-3/+7
|
* db, io: load repositories also from etc/apk/repositories.d/*.listTimo Teräs2012-02-221-12/+31
| | | | | Load additional repositories from $ROOT/etc/apk/repositories.d/*.list unless --repositories-file is given as parameter.
* db: merge identical repositoriesTimo Teräs2012-02-221-5/+17
| | | | Just in case same repository is mentioned with different tags.
* db, solver, io: scan cache items at startupTimo Teräs2012-02-221-25/+80
| | | | | | 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.
* apk: fix some unharmful leaks reported by valgrindTimo Teräs2012-02-171-0/+1
|
* solver, db: repository pinning improvementsTimo Teräs2012-02-151-12/+8
| | | | | | | | * solver internally calculates now using tags; not repository masks * installeddb now contains the tag name where the package came from -> we can now handle upgrades properly * the pinning is still a preference, and not strictly enforced; versioned dependencies may overrule preference
* db: record file uid/gid/mode in installed dbTimo Teräs2012-02-141-2/+26
|