summaryrefslogtreecommitdiffstats
path: root/src/database.c
Commit message (Collapse)AuthorAgeFilesLines
* db: Allow override arch when using --rootNatanael Copa2011-04-141-2/+5
| | | | | | | This is so we can do x86 --root installs on x86_64 hosts. Using --arch without --root can make great damage so we only enable it if --root is used.
* fetch: fix fetching of packages with archTimo Teräs2011-04-071-16/+20
|
* apk: fix gcc 4.6 warningsTimo Teräs2011-03-271-2/+1
|
* db: relocate from /var/lib/apkTimo Teräs2011-03-161-47/+59
| | | | | | | | move all files therein to other places. this allows /var to be mounted from harddisk, but rest of system be run from ramdisk. this also removes support for historical version of the scripts database which was obsoleted in 2.0_pre16 (in July 2009).
* db: move lock file to /var/lockTimo Teräs2011-03-161-2/+4
| | | | | | in accordance with FSH. this also to clear /var of apk related things as we might want to run /var as harddisk, but rest of system from ramdisk.
* db: fix cache tmpfs detectionTimo Teräs2011-03-161-1/+1
| | | | comment out the code that was out for testing. duh.
* db, cache: automatically remount cache read-write when neededTimo Teräs2011-03-161-13/+100
| | | | | | .. and back to read-only after finishing with modifications. fixes #512
* db: handle arch similarly to stable branchTimo Teräs2011-03-161-14/+23
| | | | | if package arch is not set, do not append anything to repository. if arch is set, it is appended to repository.
* db: detect tmpfs betterTimo Teräs2011-03-161-1/+4
| | | | Use statfs() filesystem type, instead of the device IDs.
* db: fix package cachingTimo Teräs2011-01-211-2/+2
|
* add: use default arch instead of noarch, improve errorsTimo Teräs2011-01-051-3/+3
| | | | | | | Packages without architecture should get the platforms default architecture (so we are backwards compatible). Only the virtual packages should get 'noarch' by default. Also print full path to the index file which failed.
* db: check and initiailize required package fields before addition to dbTimo Teräs2011-01-041-0/+5
| | | | | The atomization change broke virtual packages because they don't have license or arch set.
* pkg: recognize install_ifTimo Teräs2011-01-041-4/+15
| | | | | | | | Parse install_if from package metadata and include it in the indexes. Also setup the reverse install_if dependencies when loading a database. ref #443. Actual install_if functionality is not yet implemented.
* pkg, db: allow index with unsupported features to be loadedTimo Teräs2011-01-031-19/+32
| | | | | | Just disable installation of packages using the new stuff. Also flag lower case package info fields as non-critical and allow installation even if that features is not supported.
* various: use 'atoms' for certain package field and misc fixesTimo Teräs2010-12-141-33/+20
| | | | | | | - implement a hash table for commonly shared fields such as license, version and architecture - use macroes to print blobs or pkgname-pkgver strings - fix some old cruft
* pkg, db: add preliminary support for arch fieldTimo Teräs2010-12-141-6/+20
| | | | | | | Architecture is now: - parsed from .PKGINFO - written to index and installed db - appended to repository URL when fetching files
* db: remove support for unsigned repository indexTimo Teräs2010-12-101-33/+7
| | | | Unsigned indexes should not be needed anymore anyway.
* db: print full url/filename of the failing packageTimo Teräs2010-12-091-24/+27
| | | | .. instead of the pkgname-pkgver string.
* db: fix the previous commitTimo Teräs2010-10-081-2/+2
| | | | | id cache needs to be initialized early. and group database filename is surprisingly 'group'.
* io, db: id cache should be specific to database root, not system rootTimo Teräs2010-10-081-9/+13
| | | | | Otherwise we end up using wrong uid/gid mappings when doing install to alternate system root. Fixes #434.
* db: optionally remove dirs when unrefNatanael Copa2010-09-221-13/+15
| | | | | | | | | | We want remove dirs when they are unreferenced so we remove all dirs on apk del, but we don't want remove dirs when closing database. So we make removing dir optional when unreferencing it. This partially reverts commit c7ffc96a16c6963fe0a07be7ee75e8f1f7426882. fixes #406
* Fix building on eglibcNatanael Copa2010-08-301-0/+1
| | | | Seems like recent eglibc requires that you include sys/stat.h
* db: reinitialize trigger_pkg_list node after deletionTimo Teräs2010-06-151-0/+1
| | | | | The trigger list can be reused after it's cleared, make sure the list node is initialized all the time.
* db: --simulate never needs write access to dbTimo Teräs2010-06-121-0/+4
| | | | | So open the db in read-only mode instead. This allows --simulate to be run as non-root user.
* various: use O_CLOEXEC and add some error checkingTimo Teräs2010-06-111-10/+12
|
* db: make apk_wait a part of dboptsNatanael Copa2010-06-111-4/+3
|
* First steps for libapkNatanael Copa2010-06-111-1/+6
|
* db: do not free trigger list after package is unpackedNatanael Copa2010-06-101-6/+6
| | | | | | | | The triggers are read during apk_db_unpack_pkg(). If we delete the triggers list after then unpack we delete the triggers which is not what we want. This fixes bug introduced in ce3cf8bff901e7fcacbca640ffedaeea2b3bdf7f
* db: fix usage of apk_name_array in install_ctxTimo Teräs2010-06-071-4/+4
| | | | | got broken to the previous array cleanup and grepping struct definition only from headers.
* all: rework how arrays workTimo Teräs2010-06-051-34/+26
| | | | | | | | | | 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.
* db, pkg: fix triggers related crashTimo Teräs2010-06-011-8/+10
| | | | clean up the triggers properly, in proper order.
* fetch: do not include installed non-repository files in searchTimo Teras2010-03-041-2/+3
| | | | | we do not create mirror repositories from other valid repositories, not from what was installed locally.
* db: fix previous commitTimo Teras2010-03-011-0/+1
| | | | add the missing variable.
* db: read also non-repository package index if reading repository indexesTimo Teras2010-03-011-8/+8
| | | | | otherwise regeneration of non-repository index might go wrong or we might delete too many files from cache when doing 'cache clean'.
* db: keep packages with no files with installed statusTimo Teras2009-12-251-6/+10
| | | | | got broke few commits ago when apk_pkg_installed() call was moved to happen after the package name has been read.
* db: make fdb load package description before calling pkg_installTimo Teras2009-12-221-5/+5
| | | | | this is now mandatory after the overlay fixes. otherwise the package will not get listed as installed.
* db: check the overlay files package name rather than the ovl file itselfNatanael Copa2009-12-211-1/+1
|
* db: honor overlay file even for protected pathsTimo Teras2009-12-211-14/+12
|
* apk: remove the unneeded --never-overwriteTimo Teras2009-12-211-5/+3
| | | | | turns out the logic does not work with overlays as expected due to busybox symlinks being unmanaged. remove the useless option.
* db: accept files in overlay without directoryTimo Teras2009-12-211-5/+2
| | | | appears this is possible, so support it.
* db: use proper instance for overlay file entriesTimo Teras2009-12-211-25/+33
| | | | | lookup proper directory instance as the tar output might not be linear.
* apk: --overlay-from-stdinTimo Teras2009-12-211-3/+49
| | | | get list of overlay files from stdin, so those do not get overwritten.
* db: read time only once when writing scriptsdbTimo Teras2009-12-211-1/+3
| | | | less syscalls.
* db: check if target exist before renaming tempfileNatanael Copa2009-11-241-3/+10
| | | | | | do not overwrite target if we have --never-overwrite and target exists. ref #197
* db: fix migration and pruning of symlinks to dirsTimo Teras2009-10-261-2/+4
| | | | | | | | the old code treated a symlink to directory as file; it tried to calculate regular has of it. fix this by: 1) using no follow on migration and pruning stats, and 2) the helper function to check if it's point to directory and not calculate hash in that case. fixes #188.
* index, version: support for repository descriptions (fixes #141)Timo Teras2009-09-031-6/+10
| | | | | ability embed description information to repository indexes (e.g. repository name and version) and show it via "apk version -I".
* db: cache needs to be on non-tmpfsTimo Teras2009-08-131-1/+1
| | | | | check device major if it's tmpfs and refuse to use cache if we've been fooled.
* db: fix script argumentsTimo Teras2009-08-131-4/+8
| | | | | the first item is place holder for argv[0] = script name. it's overwritten by the apk_pkgi_run_script.
* add, del, db: fix various bugs introduced by earlier commitsTimo Teras2009-08-131-11/+9
| | | | | - make virtual packages work again - make apk del (for non-empty packages) work again
* db: implement triggers (fixes #45)Timo Teras2009-08-131-17/+135
|