use a common style to show missing or already-installed ports (FS#1843)

i3-softdeps.md: slight rewording
This commit is contained in:
John McQuah 2023-09-14 20:09:51 -04:00
parent 1287e9920d
commit d2951b0897
3 changed files with 18 additions and 10 deletions

View File

@ -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 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 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 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 software landscape. In the latter case, a KISS objection to the corresponding
prt-get is hypocritical. In the former case, it could be argued that two 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 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 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 awkward mismatch between the capabilities of prt-get, and the ports that it

View File

@ -159,8 +159,9 @@ InstallTransaction::install( const ArgParser* parser )
} else if ( (! m_config->preferHigher()) } else if ( (! m_config->preferHigher())
|| parser->strictDiff() || parser->strictDiff()
|| rpDiff == VersionComparator::GREATER || rpDiff == VersionComparator::GREATER
|| parser->pkgmkArgs().find(forceRebuild) != || ( parser->pkgmkArgs().find(forceRebuild) != string::npos &&
string::npos ) { find(parser->otherArgs().begin(), parser->otherArgs().end(),
it->first) != parser->otherArgs().end() ) ) {
update = true; update = true;
} else { } else {
continue; continue;
@ -465,9 +466,6 @@ bool InstallTransaction::calculateDependencies()
const Package* package = it->second; const Package* package = it->second;
if ( package ) { if ( package ) {
checkDependencies( false, package ); checkDependencies( false, package );
} else {
m_missingPackages.
push_back( make_pair( it->first, string("") ) );
} }
} }
list<int> indexList; list<int> indexList;
@ -652,9 +650,8 @@ bool InstallTransaction::calcDependencies( )
if ( validPackages and (!calculateDependencies()) ) { if ( validPackages and (!calculateDependencies()) ) {
cout << "Could not resolve dependencies for this transaction" << endl; cout << "Could not resolve dependencies for this transaction" << endl;
return false;
} }
return true; return validPackages;
} }
const list<string>& InstallTransaction::ignoredPackages() const const list<string>& InstallTransaction::ignoredPackages() const

View File

@ -568,7 +568,18 @@ void PrtGet::install( bool dependencies ) {
// early exit when dependencies cannot be satisfied // early exit when dependencies cannot be satisfied
if (!depck) { return; } if (!depck) { return; }
const list<string>& deps = depTransaction.dependencies(); list<string> deps = depTransaction.dependencies();
const list< pair<string,string> >& depMissing = depTransaction.missing();
list< pair<string,string> >::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 ); InstallTransaction transaction( deps, m_repo, m_pkgDB, m_config );
executeTransaction( transaction ); executeTransaction( transaction );