Commit Graph

143 Commits (6c96730cdf86f900bc74429dc35b6edb4bcaa784)

Author SHA1 Message Date
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
Timo Teras c1fe6d08f3 db: fix checksum storing to db
also take precautions in audit code if the db is missing the
checksum.
2009-07-30 11:55:59 +03:00
Timo Teras 5b48b85560 audit: protection mask for "symlinks only"
and use it for /etc/init.d by default. fixes #99.
2009-07-30 10:42:20 +03:00
Timo Teras f482701eee db: fix protected directory handling (fixes #89)
we don't want to do checksumming of existing files unless it's
in a protected directory. also, we keep the original file if it's
*modified*.
2009-07-29 19:39:59 +03:00
Timo Teras 7b05eef61f tar: make checksumming of inner files conditional
and force checksumming only when unpacking archive. otherwise
it's extra computation for nothing.
2009-07-29 19:16:04 +03:00
Timo Teras 195859b3fd db: fix repository write locking 2009-07-24 14:12:59 +03:00
Timo Teras e1b489c8b5 db: increase required verbosity for filename prints 2009-07-24 14:04:57 +03:00
Timo Teras c8c52e1dc6 db: remove APK_NAME_VIRTUAL flag
use the package 'installed_size' == 0 as a test instead for
dependency only packages.
2009-07-24 14:02:56 +03:00
Timo Teras e5be34335c db: create cache index with non-repository packages
this enables virtual packages and files specified from command
line to work on non-harddisk installs.
2009-07-24 14:00:57 +03:00
Timo Teras 042879f417 index: fully process archive when reading index for signature check
can't cancel an index reading or we lose signature checking.
2009-07-23 11:41:10 +03:00
Timo Teras a388f4bfa6 index: more informative error message
when failed to load an existing index.
2009-07-23 11:35:40 +03:00
Timo Teras 90aaa28a95 apk: add --purge option (fixes #61)
and do not remove modified configuration files unless --purge is
specified.
2009-07-22 21:34:25 +03:00
Timo Teras 718ef3079e add: fixes to installing non-repository package
make sure cache is enabled on non-permanent rootfs setups.
some optimizations and fixes too.
2009-07-22 20:47:21 +03:00
Timo Teras 23582a0ec5 db: honour clean-protected flag again 2009-07-22 16:00:14 +03:00
Timo Teras 93f0b3524c various: more informative error messages 2009-07-22 14:56:27 +03:00
Timo Teras 0a7991f70d various: misc fixes
- error codes for verification failure types
- fix some fdb corruption on file migration
- combine some dependency parsing code
- fix versioned dependencies
2009-07-22 14:24:19 +03:00
Timo Teras 0dadc27ce1 db: fix protected directory handling
do not overwrite untracked files.
2009-07-22 12:00:56 +03:00
Timo Teras 680a301511 various: installation fixes
- extract everything as .apk-new and overwrite only after data
  has been checksummed
- url construction fixes (to work with simple http servers)
- end of gunzip stream fixed
- remove oneshot digesting flag for now as it's usage was broken
2009-07-22 11:36:55 +03:00
Timo Teras 772e4aa26a various: fix installation of new style apks 2009-07-21 18:25:22 +03:00
Timo Teras 2345548e45 index: read also new style index files 2009-07-21 17:59:08 +03:00
Timo Teras 75802cb07d db: increase hash sizes a bit 2009-07-21 14:26:06 +03:00
Timo Teras 1339b14365 db: don't run pre-install until control data is verified
to make sure the scripts have not been altered.
2009-07-21 14:06:35 +03:00
Timo Teras 84e3786e05 db: fixes to package checksumming while installing it 2009-07-21 13:49:35 +03:00
Timo Teras 89d1abe4e6 db: write errors about repository update (fixes #70) 2009-07-20 11:41:45 +03:00
Timo Teras eca9c22205 db: signed index loading (ref #46)
prefer index in the new format as signed .tar.gz.
2009-07-20 11:13:03 +03:00
Timo Teras e30834fdcb digest: use oneshot context flag where approriate
speeds up digest calculation on some cases.
2009-07-17 15:56:09 +03:00
Timo Teras 6b471bb614 various: new style index generation
change the index generation to do old index, or the new style index
where package identity is sha1 of control block and it's contained
within an .tar.gz to allow signing in future.
2009-07-16 15:16:05 +03:00