aboutsummaryrefslogtreecommitdiffstats
path: root/src/database.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* db: fix some (unimportant) memory leaksTimo Teras2009-08-121-1/+9
|
* db, pkg: separate structure for fields of installed packagesTimo Teras2009-08-121-69/+138
| | | | | | | this makes the database package entry smaller, and we propbably get more fields to installed_package later too. this cleans up the way scripts are stored and is a preparation for supporting triggers. some parsing for trigger meta-data. ref #45.
* io: better error handling when writing stuff outTimo Teras2009-08-121-25/+37
| | | | | | also have the output stream support writing to temporary file and do renameat/unlinkat on close depending on if all writes succeeded or not.
* archive: update for new place of checksum in tar headerTimo Teras2009-08-111-10/+0
| | | | and take checksums for symlinks too.
* db, audit: audit symlinks (by hash of the link target)Timo Teras2009-08-111-1/+11
|
* db: fix checking of non-repository files from cacheTimo Teras2009-08-111-13/+32
| | | | | otherwise, non repository files present in cache are not considered for installation (e.g. when booting from cdrom).
* pkg, db: execute scripts from /var/cache/misc (fixes #129)Timo Teras2009-08-111-0/+2
|
* db: fix previous commitTimo Teras2009-08-111-2/+2
|
* db: ignore empty lines in /etc/apk/repositoriesNatanael Copa2009-08-111-1/+1
| | | | fixes #127
* db, pkg: fix package verification during installationTimo Teras2009-08-101-0/+3
| | | | | | some hooks to package verification code were missing causing the verification to not be done (causing pre-script to be not run). fixes #124, #126.
* state: do not look into world in state_newTimo Teras2009-08-061-3/+0
| | | | | instead enforce world dependencies when the package name is first referenced upon.
* db: prefer local repositories, and implement --no-networkTimo Teras2009-08-061-8/+37
| | | | this helps boots sequence when network is not available.