From d2951b0897e9fb84c8a0b5814302229cce9c2901 Mon Sep 17 00:00:00 2001 From: John McQuah Date: Thu, 14 Sep 2023 20:09:51 -0400 Subject: [PATCH] use a common style to show missing or already-installed ports (FS#1843) i3-softdeps.md: slight rewording --- doc/i3-softdeps.md | 4 ++-- src/installtransaction.cpp | 11 ++++------- src/prtget.cpp | 13 ++++++++++++- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/doc/i3-softdeps.md b/doc/i3-softdeps.md index 122f7bb..858aa44 100644 --- a/doc/i3-softdeps.md +++ b/doc/i3-softdeps.md @@ -81,8 +81,8 @@ present state. That nobody bothered to propose such a dup is a clear indication that we are not going back to non-fluid Pkgfiles anytime soon. So either our Pkgfiles have irrevocably become "just a bit" more complex (and therefore no longer "simple"), or they are in fact the simplest way to accommodate the modern -software landscape. In the latter case, a KISS objection to any new logic in -prt-get is hypocritical. In the former case, it could be argued that two +software landscape. In the latter case, a KISS objection to the corresponding +logic in prt-get is hypocritical. In the former case, it could be argued that two wrongs do not make a right, and the trend away from KISS Pkgfiles does not justify making prt-get "just a bit" more complex. But then we would have an awkward mismatch between the capabilities of prt-get, and the ports that it diff --git a/src/installtransaction.cpp b/src/installtransaction.cpp index facf5cb..6cc058a 100644 --- a/src/installtransaction.cpp +++ b/src/installtransaction.cpp @@ -159,8 +159,9 @@ InstallTransaction::install( const ArgParser* parser ) } else if ( (! m_config->preferHigher()) || parser->strictDiff() || rpDiff == VersionComparator::GREATER - || parser->pkgmkArgs().find(forceRebuild) != - string::npos ) { + || ( parser->pkgmkArgs().find(forceRebuild) != string::npos && + find(parser->otherArgs().begin(), parser->otherArgs().end(), + it->first) != parser->otherArgs().end() ) ) { update = true; } else { continue; @@ -465,9 +466,6 @@ bool InstallTransaction::calculateDependencies() const Package* package = it->second; if ( package ) { checkDependencies( false, package ); - } else { - m_missingPackages. - push_back( make_pair( it->first, string("") ) ); } } list indexList; @@ -652,9 +650,8 @@ bool InstallTransaction::calcDependencies( ) if ( validPackages and (!calculateDependencies()) ) { cout << "Could not resolve dependencies for this transaction" << endl; - return false; } - return true; + return validPackages; } const list& InstallTransaction::ignoredPackages() const diff --git a/src/prtget.cpp b/src/prtget.cpp index 46d0b29..2bd24a5 100644 --- a/src/prtget.cpp +++ b/src/prtget.cpp @@ -568,7 +568,18 @@ void PrtGet::install( bool dependencies ) { // early exit when dependencies cannot be satisfied if (!depck) { return; } - const list& deps = depTransaction.dependencies(); + list deps = depTransaction.dependencies(); + const list< pair >& depMissing = depTransaction.missing(); + list< pair >::const_iterator it = depMissing.begin(); + + // ensure that missing ports are retained for the + // post-transaction summary (FS#1843). Exempt any ports that were + // installed manually or from repos that have since been deactivated. + for (; it != depMissing.end(); ++it) { + if (! m_pkgDB->isInstalled(it->first)) { + deps.push_back(it->first); + } + } InstallTransaction transaction( deps, m_repo, m_pkgDB, m_config ); executeTransaction( transaction );