Commit Graph

41 Commits (eb8f44d629aca3a780f7feedfee11794f14082ad)

Author SHA1 Message Date
Timo Teräs 02cd5a9c76 make del, fetch, fix and info return errors
In case all applet arguments are packages names (that is are not
including wildcards), return error if they do not match to some
package.
2014-12-08 08:31:41 +02:00
Timo Teräs 38e3f54638 rework option parsing to have a group structure
Add also a new 'commit' group that is the common options
for all applets that can commit package changes.
2014-10-08 15:29:27 +03:00
Timo Teräs 2c4f6bb503 del: allow deletion of world dependency when it is not installed
this happens e.g. after tmpfs boot when not all packages where
available: the dependency is in world, but not installed.
2014-05-19 08:49:55 +03:00
Timo Teräs 3f8c817b6e del: don't print own name as reverse dependency 2013-07-08 15:18:10 +03:00
Dubiousjim f45aefd961 add, del: main dependencies -> 'world'
Acked-by: Natanael Copa <ncopa@alpinelinux.org>
2013-06-28 13:47:14 +03:00
Timo Teräs 81152df214 applets: unify help message by removing final dots 2013-06-19 16:49:14 +03:00
Timo Teräs 9c54ef726c fetch, del: perform wildcard matching
ref #511
2013-06-19 14:49:44 +03:00
Timo Teräs 0c1a26f25c del: fix a segfault when trying to delete uninstalled packages 2013-06-19 11:01:08 +03:00
Timo Teräs fe41ae07b9 apk: use string array in applet mains, separate apk_name_foreach_matching 2013-06-18 13:02: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 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 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 60f9a03174 del: consider also reverse dependencies for provided names
So we get better error report if package is not deleted due to
reverse dependency.
2012-10-09 13:09:56 +03: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 0800d7e050 solver: record repository tag, and flags in solution
name state could get overwritten later, so we can't use that when
generating the changeset.
2012-02-16 10:57:52 +02: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 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 e34d2ed5fd solver, db: run triggers in dependency order
fixes #738
2011-09-14 11:30:35 +03:00
Timo Teräs 1817b0a3c3 all: update copyright year statement 2011-09-13 11:53:01 +03:00
Timo Teräs 4bf13c3d9a del: fix recursive deletion and messages (after solver merge)
Deduce the world dependencies to remove locally, and same for the
additional messages about packages not deleted.
2011-09-09 19:41:19 +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
Natanael Copa e43ec60874 state: use db in own struc when committing
The db parameter to apk_state_commit is not needed so we remove it.
2011-03-30 12:53:02 +00:00
Timo Teräs b01d144c69 various: fix breakage from converting dependency versions to atoms
The version now needs to be initialized atom always, since it's
dereferenced in various places.
2011-01-01 12:11:49 +02: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 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 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 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 ec2ade1542 state: fix world dependencies to be honored always
previously they might have been skipped on certain situations.
this also fixes some other reverse dependency enforcements and
implements new "pending" state for locked name.
2009-08-04 13:57:54 +03:00
Timo Teras 6f8526da3e del: add '-r' to remove top-level dependencies recursively
and by default just update the world, and dump a lost of packages
that are not removed. fixes #47.
2009-08-04 10:57:33 +03:00
Timo Teras 7a29678aac help: auto construct help
And add some more verbosity to the help message.
2009-06-25 15:14:07 +03:00
Natanael Copa 61213c4018 improve --help output
apk --help will list the generic options only and give a list of commands
To get the details for a spefic command, 'apk command --help' should be used.
2009-06-19 15:40:37 +02:00
Natanael Copa ade1841541 fix misc compiler warnings about unintialized variables.
The compiler is actually right about those.
2009-05-11 12:17:35 +00:00
Timo Teras 968dfbb8b3 pkg: apk_deps_del helper introduced 2009-04-16 16:32:04 +03:00
Timo Teras 4e08c87621 del: first remove all targets from world, and then calculate changes 2009-04-16 15:37:53 +03:00
Timo Teras a23f6f4afb state: rework changeset calculation algorithm
Calculate changesets directly by stabilizating the package graph instead of
recalculating the whole graph and then diffing (similar approach as seen
in 'smart' package manager). The algorithm is not complete: defferred
search space forking is missing. So you don't always get a solution on
complex graphs.

Benefits:
- usually the search state tree is smaller (less memory used)
- speed relational to changeset size, not database size (usually faster)
- touch only packages related to users request (can work on partitially
  broken state; upgrades only necessary packages, fixes #7)

Also implemented:
- command prompt to confirm operation if packages are deleted or downgraded
- requesting deletion of package suggests removal of all packages depending
  on the package being removed (you'll get list of packages that also get
  removed if you want package X removed)
- option --simulate to see what would have been done (mainly for testing)
- an untested implementation of versioned dependencies and conflicts

A lot has changed, so expect new bugs too.
2009-04-14 18:48:02 +03:00
Timo Teras a98b57b1ae db: database locking and creation to part of opening it
Add flags field to db open call. Also make error reporting quite a bit
more detailed.
2009-01-17 11:08:48 +02:00
Timo Teras 3755e1cde3 apk: per applet options 2009-01-13 14:09:45 +02:00
Timo Teras 823283edca Argument parsing. Some other stuff too. 2008-04-21 16:30:10 +00:00
Timo Teras d6c7435242 Initial commit of some stuff written so far. Still in state of flux. Expect
breakage and major changes.
2008-04-17 14:09:13 +00:00