Timo Teräs
95555ede4d
db: more fix for read-only cache remounting
...
remount to read-write before trying to create the cache directory
subdirs. fix a fd leak that might prevent remounting back to rw.
2011-05-27 16:49:25 +03:00
Natanael Copa
38e54240a3
db: remount read-only after the file handles have been closed
...
The apk cache might be on the readonly media so we need wait with
remounting til after atleast this filehandle is closed.
2011-05-27 11:38:50 +00:00
Timo Teräs
c5de3cdc4c
db: fix post-install script error message formatting
2011-05-23 15:32:32 +03:00
Timo Teräs
9901058891
db: remount ro cache to rw earlier for update to work
2011-04-22 11:24:33 +03:00
Natanael Copa
cec1fa2b0f
db: Allow override arch when using --root
...
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.
2011-04-14 19:59:01 +00:00
Timo Teräs
91c4cc6c18
fetch: fix fetching of packages with arch
2011-04-07 14:14:27 +03:00
Timo Teräs
8e01be4777
apk: fix gcc 4.6 warnings
2011-03-27 02:51:51 +02:00
Timo Teräs
93eb38a31a
db: relocate from /var/lib/apk
...
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).
2011-03-16 16:53:07 +02:00
Timo Teräs
2222a15edd
db: move lock file to /var/lock
...
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.
2011-03-16 15:39:36 +02:00
Timo Teräs
5d64bc5d8c
db: fix cache tmpfs detection
...
comment out the code that was out for testing. duh.
2011-03-16 15:21:41 +02:00
Timo Teräs
415e230a7f
db, cache: automatically remount cache read-write when needed
...
.. and back to read-only after finishing with modifications.
fixes #512
2011-03-16 14:56:13 +02:00
Timo Teräs
1e17da9d70
db: handle arch similarly to stable branch
...
if package arch is not set, do not append anything to repository.
if arch is set, it is appended to repository.
2011-03-16 14:56:13 +02:00
Timo Teräs
15badbfd97
db: detect tmpfs better
...
Use statfs() filesystem type, instead of the device IDs.
2011-03-16 14:56:13 +02:00
Timo Teräs
1c6ab67984
db: fix package caching
2011-01-21 09:37:19 +02:00
Timo Teräs
0e450c5fb6
add: use default arch instead of noarch, improve errors
...
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.
2011-01-05 14:33:16 +02:00
Timo Teräs
94ce7f01bf
db: check and initiailize required package fields before addition to db
...
The atomization change broke virtual packages because they don't
have license or arch set.
2011-01-04 11:45:34 +02:00
Timo Teräs
28dcd5d3b3
pkg: recognize install_if
...
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.
2011-01-04 10:05:20 +02:00
Timo Teräs
d8ba07e484
pkg, db: allow index with unsupported features to be loaded
...
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.
2011-01-03 21:06:41 +02:00
Timo Teräs
972bec3210
various: use 'atoms' for certain package field and misc fixes
...
- 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
2010-12-14 19:51:16 +02:00
Timo Teräs
fca1c30b80
pkg, db: add preliminary support for arch field
...
Architecture is now:
- parsed from .PKGINFO
- written to index and installed db
- appended to repository URL when fetching files
2010-12-14 17:06:29 +02:00
Timo Teräs
6e34f048c7
db: remove support for unsigned repository index
...
Unsigned indexes should not be needed anymore anyway.
2010-12-10 16:42:25 +02:00
Timo Teräs
6e89c1d5b7
db: print full url/filename of the failing package
...
.. instead of the pkgname-pkgver string.
2010-12-09 11:10:12 +02:00
Timo Teräs
6398d338c6
db: fix the previous commit
...
id cache needs to be initialized early. and group database filename
is surprisingly 'group'.
2010-10-08 16:09:03 +03:00
Timo Teräs
19419f1a88
io, db: id cache should be specific to database root, not system root
...
Otherwise we end up using wrong uid/gid mappings when doing install
to alternate system root. Fixes #434 .
2010-10-08 15:36:54 +03:00
Natanael Copa
5c4583a902
db: optionally remove dirs when unref
...
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 c7ffc96a16
.
fixes #406
2010-09-22 14:34:35 +00:00
Natanael Copa
b4adf7645f
Fix building on eglibc
...
Seems like recent eglibc requires that you include sys/stat.h
2010-08-30 13:04:25 +00:00
Timo Teräs
ec6359732d
db: reinitialize trigger_pkg_list node after deletion
...
The trigger list can be reused after it's cleared, make sure
the list node is initialized all the time.
2010-06-15 14:40:46 +03:00
Timo Teräs
8b317678e3
db: --simulate never needs write access to db
...
So open the db in read-only mode instead. This allows --simulate to
be run as non-root user.
2010-06-12 13:48:42 +03:00
Timo Teräs
43cb554c3f
various: use O_CLOEXEC and add some error checking
2010-06-11 13:42:21 +03:00
Natanael Copa
36d1bfb4ed
db: make apk_wait a part of dbopts
2010-06-11 07:02:18 +00:00
Natanael Copa
3ec82a5a42
First steps for libapk
2010-06-11 07:02:18 +00:00
Natanael Copa
60b537e356
db: do not free trigger list after package is unpacked
...
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 ce3cf8bff9
2010-06-10 17:50:11 +00:00
Timo Teräs
f85d87e5f9
db: fix usage of apk_name_array in install_ctx
...
got broken to the previous array cleanup and grepping struct
definition only from headers.
2010-06-07 17:45:04 +03:00
Timo Teräs
7be853e637
all: rework how arrays work
...
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.
2010-06-05 12:33:54 +03:00
Timo Teräs
ce3cf8bff9
db, pkg: fix triggers related crash
...
clean up the triggers properly, in proper order.
2010-06-01 16:46:53 +03:00
Timo Teras
ef7d467083
fetch: do not include installed non-repository files in search
...
we do not create mirror repositories from other valid repositories,
not from what was installed locally.
2010-03-04 14:01:37 +02:00
Timo Teras
49f5d8cb01
db: fix previous commit
...
add the missing variable.
2010-03-01 11:26:45 +02:00
Timo Teras
fcdb316ab7
db: read also non-repository package index if reading repository indexes
...
otherwise regeneration of non-repository index might go wrong or we
might delete too many files from cache when doing 'cache clean'.
2010-03-01 11:20:17 +02:00
Timo Teras
3f9fe4c28b
db: keep packages with no files with installed status
...
got broke few commits ago when apk_pkg_installed() call was
moved to happen after the package name has been read.
2009-12-25 14:15:10 +02:00
Timo Teras
b58ec46f7c
db: make fdb load package description before calling pkg_install
...
this is now mandatory after the overlay fixes. otherwise the
package will not get listed as installed.
2009-12-22 17:33:44 +02:00
Natanael Copa
d4f0b2ab70
db: check the overlay files package name rather than the ovl file itself
2009-12-21 16:39:53 +00:00
Timo Teras
884fabbf30
db: honor overlay file even for protected paths
2009-12-21 18:12:45 +02:00
Timo Teras
6417de4d10
apk: remove the unneeded --never-overwrite
...
turns out the logic does not work with overlays as expected due
to busybox symlinks being unmanaged. remove the useless option.
2009-12-21 16:53:47 +02:00
Timo Teras
f44f34811d
db: accept files in overlay without directory
...
appears this is possible, so support it.
2009-12-21 16:31:58 +02:00
Timo Teras
f2a7800b22
db: use proper instance for overlay file entries
...
lookup proper directory instance as the tar output might not be
linear.
2009-12-21 14:30:33 +02:00
Timo Teras
d0909569c6
apk: --overlay-from-stdin
...
get list of overlay files from stdin, so those do not get overwritten.
2009-12-21 14:14:02 +02:00
Timo Teras
366e7d07ae
db: read time only once when writing scriptsdb
...
less syscalls.
2009-12-21 11:42:39 +02:00
Natanael Copa
407ef801d9
db: check if target exist before renaming tempfile
...
do not overwrite target if we have --never-overwrite and target exists.
ref #197
2009-11-24 08:25:24 +00:00
Timo Teras
a7360395ea
db: fix migration and pruning of symlinks to dirs
...
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 .
2009-10-26 09:46:09 +02:00
Timo Teras
58e771303c
index, version: support for repository descriptions ( fixes #141 )
...
ability embed description information to repository indexes
(e.g. repository name and version) and show it via "apk version -I".
2009-09-03 14:56:24 +04:00