Commit Graph

103 Commits (23c39085ce3b2ac80b4c643d1a0855cfdcd91c35)

Author SHA1 Message Date
Timo Teräs 34756e6b87 solver: report number of (mega)bytes used 2011-12-27 14:06:03 +02:00
Timo Teräs 500f8d4a7d solver, db: implement repository pinning
Improves /etc/apk/repositories format so you can say:
http://nl.alpinelinux.org/alpine/v2.3/main
@edge http://nl.alpinelinux.org/alpine/edge/main
@testing http://nl.alpinelinux.org/alpine/edge/testing

After which you can pin dependencies to these tags using:
 apk add stableapp newapp@edge bleedingapp@testing

Apk will now by default only use the untagged repositories,
but adding a tag to specific dependency:
 1. will prefer that tag for the name
 2. allowing pulling in dependencies from that tag (though,
    it prefers untagged packages to satisfy deps if possible)

fixes #575
2011-10-29 05:18:21 +03:00
Timo Teräs e682e6596c solver, pkg: implement versioned conflicts
One can now say in dependency "!foo<2" which means, that if foo is
installed, it needs to be >=2, but it's not a required dependency.
2011-10-24 10:16:40 -04:00
Timo Teräs 89d003f8c2 pkg: introduce "replaces_priority"
If two packages replace each other, the one with highes priority
will keep the file. Additionally, if we have a package overriding
another's file it's remembered and handled properly. This is
essentially to allow "policy packages" which just overwrite certain
(configuration) files from other package(s).
2011-10-19 11:38:23 -04:00
Timo Teräs a787038dbe pkg, info: remember installed packages "replaces"
"replaces" is now turned to a full dependency type list, so you can
make package overwrite files only certain versions of the package
(though, we should probably take this into account already at solution
calculation phase).

Also make 'info --replaces' print the "replaces" of the package.

This is in preparation for the policy package support, which still
requires "replacement priority" field to decide which packages' files
get the preference.
2011-10-18 18:11:26 -04:00
Timo Teräs f4ac687a8a pkg: fix dependency checking against non-installed packages
the solver requires this.
2011-09-27 11:38:16 +03:00
Timo Teräs 1817b0a3c3 all: update copyright year statement 2011-09-13 11:53:01 +03:00
Timo Teräs 7d5cd2c8a0 pkg: consider script failure as non-fatal
Make a loud warning if the script returns failure, but do not
abort installation sequence because of that.
2011-09-09 20:16:48 +03:00
Timo Teräs a5a7021658 applets: start using solver code
still todo:
  - 'fix' is missing
  - 'del -R' does not work
  - 'upgrade' does not do self-upgrade first

... and a lot of testing.
2011-09-09 16:32:31 +03:00
Timo Teräs 433da92e37 index: handle errors instead of silently failing
Make indexer keep noise about errors that prevent index generation.
Detect certain errors in the APKs better. And also have the applet
return error in these scenarios.
2011-06-28 15:40:52 +03:00
Timo Teräs 5a9d8323a0 pkg: add origin, maintainer, build_time and commit id to index
Parse these fields from .PKGINFO, and write them to index.
2011-04-04 14:05:52 +03: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 1c7e8d2617 pkg: dependencies to specific package checksum
When package is installed from commandline, we should always
install that specific instance of package (never favor repository
version if it has difference identity). Otherwise we might not
always end-up installing the .apk given on command line. The
dependency is now against specific checksum identity (marked
with >< dependency comparison). Fixes #492.
2011-01-01 16:58:58 +02:00
Timo Teräs 6582676150 various: use APK_DEPMASK_REQUIRE where applicable
.. instead of the longer flag combo.
2011-01-01 16:04:42 +02:00
Timo Teräs 0cc41ba4dc index: remove support of old index format
It's no longer needed or used.
2011-01-01 12:17:06 +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 1f985b9d0f pkg: remove support for obsolete APKv1 (alpine-1.8 and earlier)
should not be needed anymore.
2010-12-10 16:29:40 +02: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 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 3062d681f9 archive: honor username/groupname instead of uid/gid
Take the uid/gid from passwd and group.
2010-06-12 13:43:29 +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 3ec82a5a42 First steps for libapk 2010-06-11 07:02:18 +00: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 Teräs 038b672061 state: improve error messages from dependency failures
Print more information why installation changeset calculation failed.
Fixes #187.
2010-06-01 11:49:32 +03:00
Timo Teräs fe55da7074 package: don't leak signing key file fd
openssl BIO does not close the fd unless we explicitly tell it to
do so.
2010-05-26 14:30:08 +03: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 aebe73549f pkg: fix parsing of empty dependencies
if the dependencies are empty with only trailing new line, the
parsing was incorrect. fix the new line check.
2009-09-16 20:23:34 +03:00
Timo Teras 6b94ed8a7a fix: parse pkgfile properly (fixes #132)
accept also pkgfile in addition to pkgname. make also the signature
verification stuff work properly again with non-repository files.
2009-08-13 14:33:43 +03:00
Timo Teras 279513bfbe db: implement triggers (fixes #45) 2009-08-13 14:10:30 +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 5d19789a3b pkg, db: execute scripts from /var/cache/misc (fixes #129) 2009-08-11 17:56:24 +03: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 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 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
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 8e66768cd2 pkg: remove implicit bb dependency when install script is present
this dependency is now inserted automatically by abuild.
2009-07-24 14:06:03 +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 79f43861e6 signing: verify and generate identity
fixes verification of non-repository packages while installing
them. this is final thing needed for full signing support
(fixes #46).
2009-07-22 21:04:54 +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 9b77c053e8 pkg: cleanup the signing code
smaller callback and less cases to check. also reintroduce the
oneshot digest flag, hopefully correct this time.
2009-07-22 19:56:13 +03:00
Timo Teras 5375efac1a apk: allow-untrusted option
to not make hard error of untrusted or missing signatures
2009-07-22 16:06:34 +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 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 812483515a pkg: fix indexing of multi-part apks 2009-07-21 17:37:44 +03:00
Timo Teras 84e3786e05 db: fixes to package checksumming while installing it 2009-07-21 13:49:35 +03:00