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
Timo Teras
9e71df3cf3
db: cache needs to be on non-tmpfs
...
check device major if it's tmpfs and refuse to use cache if
we've been fooled.
2009-08-13 20:27:33 +03:00
Timo Teras
e20ce5a9c0
db: fix script arguments
...
the first item is place holder for argv[0] = script name. it's
overwritten by the apk_pkgi_run_script.
2009-08-13 19:21:31 +03:00
Timo Teras
6c96730cdf
add, del, db: fix various bugs introduced by earlier commits
...
- make virtual packages work again
- make apk del (for non-empty packages) work again
2009-08-13 18:41:03 +03:00
Timo Teras
279513bfbe
db: implement triggers ( fixes #45 )
2009-08-13 14:10:30 +03:00
Timo Teras
05f016481a
db: fix some (unimportant) memory leaks
2009-08-12 19:29:14 +03:00
Timo Teras
36b5cee98b
db, pkg: separate structure for fields of installed packages
...
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 .
2009-08-12 19:17:46 +03:00
Timo Teras
dee6ffa492
io: better error handling when writing stuff out
...
also have the output stream support writing to temporary file
and do renameat/unlinkat on close depending on if all writes
succeeded or not.
2009-08-12 11:05:09 +03:00
Timo Teras
bd9835a20e
archive: update for new place of checksum in tar header
...
and take checksums for symlinks too.
2009-08-11 19:57:30 +03:00
Timo Teras
addae04c26
db, audit: audit symlinks (by hash of the link target)
2009-08-11 19:02:22 +03:00
Timo Teras
949d375aa9
db: fix checking of non-repository files from cache
...
otherwise, non repository files present in cache are not
considered for installation (e.g. when booting from cdrom).
2009-08-11 18:28:22 +03:00
Timo Teras
5d19789a3b
pkg, db: execute scripts from /var/cache/misc ( fixes #129 )
2009-08-11 17:56:24 +03:00
Timo Teras
1011c4e346
db: fix previous commit
2009-08-11 16:01:29 +03:00
Natanael Copa
6dd59d7817
db: ignore empty lines in /etc/apk/repositories
...
fixes #127
2009-08-11 09:22:12 +00:00
Timo Teras
bc93eaffb0
db, pkg: fix package verification during installation
...
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 .
2009-08-10 08:47:05 +03:00
Timo Teras
bf7b80662d
state: do not look into world in state_new
...
instead enforce world dependencies when the package name
is first referenced upon.
2009-08-06 16:39:09 +03:00
Timo Teras
f02f326238
db: prefer local repositories, and implement --no-network
...
this helps boots sequence when network is not available.
2009-08-06 16:00:20 +03:00
Timo Teras
ecdacd1503
all: implement database open options
...
so user can override trusted keys directory and repositories file.
2009-08-06 14:25:03 +03:00
Timo Teras
fac43e2d60
db: make missing index non-fatal
...
it's a warning not an error to have non-existant repository.
bad signature means tampering; but we might want to just ignore
those. this is especially important if we have http repositories
and we are bootstrapping (without network).
2009-08-06 13:12:26 +03:00
Timo Teras
6f1de8cd53
db: command line repositories take preference
...
over the ones in config file. also remove the apk_root == NULL
check as this cannot happen anymore. a valid root is always
required.
2009-08-06 10:17:28 +03:00
Timo Teras
a602c49b31
db: support "replaces" directive ( fixes #113 )
...
it will allow to overwrite files owned by some other packages
to get upgrades right (e.g. when splitting or renaming packages)
2009-08-04 16:54:15 +03:00
Timo Teras
1fea5639b4
fix: new applet to reinstall and fix package
...
also makes it possibly to upgrade package without adding it to
top-level deps. fixes #69 .
2009-08-04 15:19:29 +03:00
Timo Teras
8c19869c29
db: return hard error if repository opening fails
...
otherwise we can accept unsigned repositories, and install bad
packages.
2009-08-04 11:08:19 +03:00
Timo Teras
1029d15ecd
db: jump through hoops to get checksums for hardlinks
...
should really fix abuild-tar.
2009-07-31 20:05:04 +03:00
Timo Teras
123226bad2
db: load cache's installed index only if cache is active
...
other wise cache_fd points to var/lib/apk and contains the real
installed db causing it to be loaded twice.
2009-07-31 19:35:08 +03:00
Timo Teras
ea90152664
apk: use *at instead of chdir+normal file syscall
...
this way we never change cwd, and relative filenames are always
parsed consistently. this also helps filename construction in many
places. this patch also changes '--root' to override location of
all configuration to be in the new root. previously it depended
on the file which one was used.
2009-07-31 16:08:09 +03:00
Natanael Copa
fe43d8ab1d
db: allow update of untrusted index
2009-07-30 19:16:37 +00:00