summaryrefslogtreecommitdiff
path: root/src/database.c
AgeCommit message (Collapse)AuthorFilesLines
2015-03-10rework error handling for read streamsTimo Teräs1-14/+21
2015-02-04remove old compat. field entry from installed db handlingTimo Teräs1-1/+0
Package pinning was first implemented with 'p' tag. However, it was before any release renamed to 's', and 'p' was reserved for package provides support for which is used now.
2015-01-30always save 'world' with line feedsTimo Teräs1-3/+1
using space was for backwards compatibility with apk-tools 2.2.2 and earlier (from January 2012)
2015-01-30remove support for old database location in /varTimo Teräs1-25/+0
the location changed in apk-tools 2.1.0 (March 2011) which was used in Alpine Linux 2.2.
2014-12-08make del, fetch, fix and info return errorsTimo Teräs1-3/+1
In case all applet arguments are packages names (that is are not including wildcards), return error if they do not match to some package.
2014-11-03db: assign write permission to lock fileKaarle Ritvanen1-2/+2
Allows running apk as an unprivileged user, e.g. with fakeroot. Opening the lock file fails without the write permission.
2014-11-01make 'mode, uid, gid' triplet separate atomized structTimo Teräs1-39/+53
there are only few combinations for that triplet, and they occur multiple times reducing the struct sizes a bit. make sane defaults and prepare to not write defaults to disk to reduce on-disk installed db size.
2014-10-13db: improve and unify fdb error messagesTimo Teräs1-27/+13
2014-10-09db: unconditionally refresh index with --forceTimo Teräs1-1/+3
2014-10-08io,url,db: support for if-modified-sinceTimo Teräs1-18/+20
2014-10-07db: fix crash if unable to download cache itemTimo Teräs1-2/+3
fixes #3371
2014-10-07db: rework directory permission handlingTimo Teräs1-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
2014-10-06db: use per-pkg architecture (if available) to form download urlTimo Teräs1-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.
2014-10-06index: fix warning about package names without providerTimo Teräs1-0/+1
It's real only if there's a package with actual dependency (conflicts and install_if dependencies do not count).
2014-05-19solver: fix installation of non-repository packages during tmpfs bootTimo Teräs1-0/+2
allow packages in the cache's installed to be selected for installation by the solver. add test case for the issue.
2014-04-25db: allow replacing files of origin package is sameTimo Teräs1-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.
2014-03-12audit: include all files in etc/apk in overlayTimo Teräs1-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.
2013-10-02db: allow using cached packages with --no-networkTimo Teräs1-1/+1
2013-10-01db, url: fix exec sentinelsTimo Teräs1-1/+1
http://ewontfix.com/11/
2013-09-20db: minor improvements to an error and a verbose log messagesTimo Teräs1-2/+2
2013-09-20db: fix error messageTimo Teräs1-1/+1
2013-07-17db: fix segfault when --root points to invalid dirNatanael Copa1-1/+3
fixes #2134
2013-06-28various: applet help text and comment fixesDubiousjim1-8/+6
Acked-by: Natanael Copa <ncopa@alpinelinux.org>
2013-06-21db: write ipkg flags in proper placeTimo Teräs1-7/+8
2013-06-21db: reset broken pkg state on reinstallTimo Teräs1-0/+2
2013-06-20solver: fix pinning+cache to workTimo Teräs1-2/+0
Mistakenly allowed masked out package to be installed if it was in cache.
2013-06-20commit, db: make file conflicts and script errors non-fatalTimo Teräs1-82/+67
fixes #1482
2013-06-19all: few behavioural regression fixesTimo Teräs1-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.
2013-06-18policy: new appletTimo Teräs1-4/+4
to show different versions of package and the repositories from which it is available from.
2013-06-18db: store repository tag names including leading @Timo Teräs1-21/+35
2013-06-18apk: use string array in applet mains, separate apk_name_foreach_matchingTimo Teräs1-0/+77
2013-06-18all: various conversions to foreach_array_item, and simplifications of codeTimo Teräs1-33/+25
2013-06-17io: get rid of APK_PROGRESS_SCALETimo Teräs1-19/+4
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-5/+9
2013-06-17print: move progress printing to common functionsTimo Teräs1-1/+0
2013-06-17db, cache: do not use cache/tmp for downloadsTimo Teräs1-22/+22
instead use prefix for temporary files.
2013-06-17db: refactor repository file constructionTimo Teräs1-107/+129
Fixes also 'fetch' applet to prefer copying/linking to files from cache if possible.
2013-06-13solver, errors: fix few additional test cases and clean upsTimo Teräs1-12/+12
2013-06-13solver: rewrite as deductive solver -- core featuresTimo Teräs1-13/+19
Implementing basic dependency handling, install_if and awareness of pinning.
2013-05-30index: add sensible error message if metadata is too longTimo Teräs1-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
2013-05-30db: unify handling of special packagesTimo Teräs1-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.
2013-05-29db, info: allow packages to install files/symlinks to rootTimo Teräs1-20/+40
fixes #1578
2013-05-29db: make dev/null a character device with --initdbTimo Teräs1-1/+1
fixes #1714
2012-09-20apk: implement --progress-fd to write progress to a specified fdTimo Teräs1-0/+1
2012-09-04db: remove AT_SYMLINK_NOFOLLOW for directory permissionsTimo Teräs1-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.
2012-07-16audit: fix protection mask of non-db directoriesTimo Teräs1-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.
2012-05-01db: strip leading and trailing slashes from protected path specTimo Teräs1-0/+6
2012-04-27db: fix has_protected_children setup on leaf path entriesTimo Teräs1-1/+1
Fixes --recurse during audit.
2012-02-24solver, dot: elementary provides fixesTimo Teräs1-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.
2012-02-24all: introduce apk_provides and use it in apk_nameTimo Teräs1-7/+12
in preparation for provides support. implements also some dependency satisfaction helper routines. ref #574.