From d315c9019cf6e43dd7ecfe17e8d3896469396997 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Tue, 18 Jun 2013 16:24:48 +0300 Subject: upgrade: new option: --latest (-l) Select latest version of package (if it is not pinned), and print error if it cannot be installed due to other dependencies. Together with --available, it selects the latest package which is present at least in some repository. This also fixes few solver issues with ordering of package selection that got quite apparent with this flag. Namely, we cannot "lock" a package until it's reverse dependencies are locked or not all of the solver flags are propagated properly. --- src/upgrade.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/upgrade.c') diff --git a/src/upgrade.c b/src/upgrade.c index 41d3cf7..f23ea91 100644 --- a/src/upgrade.c +++ b/src/upgrade.c @@ -35,6 +35,9 @@ static int upgrade_parse(void *ctx, struct apk_db_options *dbopts, case 'a': uctx->solver_flags |= APK_SOLVERF_AVAILABLE; break; + case 'l': + uctx->solver_flags |= APK_SOLVERF_LATEST; + break; default: return -1; } @@ -131,6 +134,9 @@ static struct apk_option upgrade_options[] = { "replacing or downgrading packages (instead of holding them) " "if the currently installed package is no longer available " "from any repository" }, + { 'l', "latest", + "Select latest version of package (if it is not pinned), and " + "print error if it cannot be installed due to other dependencies" }, { 0x10000, "no-self-upgrade", "Do not do early upgrade of 'apk-tools' package" }, }; -- cgit v1.2.3-70-g09d2