Commit Graph

88 Commits (cute-signatures)

Author SHA1 Message Date
Timo Teräs f69ae30272 db: sort world dependencies to layers 2022-02-21 10:24:05 +02:00
Timo Teräs 9e4dd29f54 db: prepare database reading for layers 2022-02-21 10:24:05 +02:00
Timo Teräs 1ab81fdd4c db: convert v3 scripts to ipkg on install
fixes #10796
2021-12-03 14:53:30 +02:00
Timo Teräs 845fa93814 db: synthesize symlink hashes for v3 packages
The v3 format will not require the hash, but synthesize it to the
DB so v3 packages can get installed properly.

fixes #10785
2021-11-22 13:41:22 +02:00
Timo Teräs 7d6de2203e database: support loading v3 indexes 2021-11-09 21:50:11 +02:00
Timo Teräs 6941aac4c6 db, audit: support sha256-160 hashes for v3 pkg compat 2021-11-03 15:37:10 +02:00
Timo Teräs 40f0866367 db, add: support adding v3 package files 2021-10-27 16:14:45 +03:00
Timo Teräs 9c843e4ecd Refactor .apk extraction code
This moves and isolates the tar code to tar.c. And the actual
file extraction to disk is moved to extract.c.

A new API is introduced and used for v2 file extraction. This
essentially moves and isolates the apk_sign_ctx_* beast into
extract_v2.c and offers a saner interface to handling packages.

A place holder is added for v3 extraction.
2021-07-27 14:09:38 +03:00
Timo Teräs 705e002bb0 rename adb_trust to apk_trust, and use it as package signature keystore too 2020-10-09 16:09:19 +03:00
Timo Teräs 7a7eca8670 make apk_flags non-global, make progress printing state non-global
ref #10682
2020-10-09 16:09:19 +03:00
Timo Teräs e2afc7e7a9 fix, simplify and document upgrade --ignore 2020-08-24 15:26:25 +03:00
TBK 5d796b5678 use SPDX-License-Identifier in source files 2020-05-07 10:45:42 +03:00
Timo Teräs 90fc52e2b8 del: report non-matching names and install-if rule non-deletion 2019-12-29 19:40:24 +02:00
Timo Teräs beab8545eb add support for openssl 1.1 2018-10-26 08:22:08 +03:00
William Pitcock f18c708183 solver: implement support for choosing default virtuals
By introducing a new package metadata field, `provider_priority`
(index letter `k`), we can specify default packages to satisfy a
virtual.

If a user wishes to select an alternative provider for the virtual,
a changeset swapping the default provider for the selected provider
will be generated by the dependency resolver.
2017-11-02 03:08:24 +00:00
William Pitcock 693b4bcdb0 version: add support for fuzzy version matching
This is useful for requirements such as: python3=~3.6, which would match python3-3.6.[0-9].
This implementation should in theory be backwards compatible with the implementation in Adelie.
2017-05-27 21:49:53 +00:00
Timo Teräs 2a066169bd commit: self-conflict error and satisfies printing
- self-conflicts when the exact same version of a name is provided
  twice is now properly detected and diagnozed
- don't print redundant satisfies diagnostic
2015-12-10 14:30:57 +02:00
Timo Teräs 90e760339e make file install errors non-fatal, and xattr errors hidden
user xattrs on tmpfs are not supported no non-grsec kernels,
and many times root fs is mounted without user_xattr. Thus
to allow things to go smoothly on non-grsec kernels xattr
unsupported errors are now hidden.

xattrs can be fixed still now with "apk fix --xattrs"
2015-04-17 10:05:10 +03:00
Timo Teräs 1dc70477b5 solver: fix installation of non-repository packages during tmpfs boot
allow packages in the cache's installed to be selected for installation
by the solver. add test case for the issue.
2014-05-19 11:50:10 +03:00
Dubiousjim ac7616b0a9 various: applet help text and comment fixes
Acked-by: Natanael Copa <ncopa@alpinelinux.org>
2013-06-28 13:45:41 +03:00
Timo Teräs 3f27da2ade solver: fix pinning+cache to work
Mistakenly allowed masked out package to be installed if it was
in cache.
2013-06-20 14:08:16 +03:00
Timo Teräs 7e18398781 commit, db: make file conflicts and script errors non-fatal
fixes #1482
2013-06-20 13:12:44 +03:00
Timo Teräs 6da083fc24 all: few behavioural regression fixes
Wildcard matching with no names should match all packages only for
info and search applet. "apk del" would otherwise try to delete
everything, etc.

Fix also interactive mode to ask questions only if we are actually
changing something.
2013-06-19 20:56:18 +03:00
Timo Teräs 54509e7a1a all: various conversions to foreach_array_item, and simplifications of code 2013-06-18 08:03:40 +03:00
Timo Teräs 72139b82d3 fetch: implement progress (fixes #1170) 2013-06-17 17:51:41 +03:00
Timo Teräs 9d10037807 db: refactor repository file construction
Fixes also 'fetch' applet to prefer copying/linking to files from
cache if possible.
2013-06-17 14:38:27 +03:00
Timo Teräs f79e3946a4 pkg: apk_pkg_foreach_* add matching generation
So same package it is possible to not match same package multiple
times. Use generation count, so this is handled cleanly during
recursion, like in the use case of search applet.
2013-06-15 22:25:23 +03:00
Timo Teräs 5b02400b26 lua: use apk_dep_analyze
and remove the now unused apk_dep_is_materialized_or_provided
which was superceded by apk_dep_analyze.
2013-06-15 19:48:30 +03:00
Timo Teräs bcda66bf08 pkg: add global reverse dependency iterator helpers and use them
... in the error printing and the package deletion.
2013-06-13 20:48:38 +03:00
Timo Teräs e51232e710 errors: rewrite the logic how errors are reported
Instead of the dependency oriented logic, switch to print them
for each package or name needed. Might give a bit more readable
errors now. There's still few corner cases that proper error is
not output, which are cought by the test cases.
2013-06-13 18:22:00 +03:00
Timo Teräs 25ff68a87e solver: prune broken world dependencies with --force
mostly useful for reboot, when all packages are not available.
2013-06-13 18:22:00 +03:00
Timo Teräs b8c44536ca solver: rewrite as deductive solver -- core features
Implementing basic dependency handling, install_if and awareness
of pinning.
2013-06-13 18:22:00 +03:00
Timo Teräs aec93ee730 db: unify handling of special packages
make cache a special kind of repository, and automatically cache
special packages (virtual packages, or ones installed from command
line). add test cases for handling virtual packages. fixes #1617.
2013-05-30 08:48:32 +03:00
Timo Teräs 01d0e4c408 solver: optimize backjumping
to be functional when backtracking
2012-10-08 12:25:43 +03:00
Timo Teräs f27f194d92 solver, test: make conflicts unconditional
Solver will now never report partial solution where a conflict
constraint is not satisfied. The is because with --force we might
install the partial solution; and if conflicted packages were to
be installed we might have extra trouble.
2012-02-29 08:53:43 +02:00
Timo Teräs 99145e2c0d all: introduce apk_provides and use it in apk_name
in preparation for provides support. implements also some
dependency satisfaction helper routines.

ref #574.
2012-02-24 16:31:40 +02:00
Timo Teräs e128c95fdf pkg: add field for provides as 'p'
ref #574
2012-02-24 10:13:05 +02:00
Timo Teräs bf82e2e5fd db, solver, io: scan cache items at startup
It is faster to just scan the cache directory for existing packages
at startup than trying to faccessat() them on demand. It also makes
quite a few parts of the code more readable and simpler.
2012-02-22 08:45:40 +02:00
Timo Teräs 41fb3a4f9e solver, db: repository pinning improvements
* solver internally calculates now using tags; not repository masks
* installeddb now contains the tag name where the package came from
  -> we can now handle upgrades properly
* the pinning is still a preference, and not strictly enforced;
  versioned dependencies may overrule preference
2012-02-15 13:57:36 +02:00
Timo Teräs 1f9a36de68 db: support line feed as 'world' dependency separator
* default writing the world with spaces if a space is found
   (for backwards compatibility) for now
2012-01-12 14:33:29 +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 8d4d68d818 pkg: convert struct apk_install_package flags to bitfield 2011-10-19 15:26:55 -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 803f55ece5 solver: make state pointers completely internal
the only bit of information needed in solver commit is the "hard"
topology sorting information for trigger ordering. fixes a bug in
"apk del" which uses the state pointers to do intermediate
calculations between solution solving and commit.
2011-09-14 16:48:28 +03:00
Timo Teräs 1817b0a3c3 all: update copyright year statement 2011-09-13 11:53:01 +03:00
Timo Teräs 48d368e7d5 solver: move topology sorting to solver code
this allows quite some optimizations to running time and memory
requirements.
2011-08-05 14:34:58 +03:00
Timo Teräs 79b53d4d76 solver: new package selection logic (which is not yet used)
* basic code for a backtracking, forward checking dependency satisfier
 * works better when there are tricky dependencies to solve
   (when can't just upgrade everything to most preferred versions)
 * the new code always evaluates all of 'world' constraints
   (old code just does incremental updates based on heuristics)
 * is probably somewhat slower than old code (probably unnoticeable
   difference in most cases)
 * makes easier to write support for provides and repository pinning
 * test applet and a bunch of test cases added which uses the new code
 * from the old feature set install_if is not yet implemented
2011-07-26 17:08:43 +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