consolidate the tests in calcDependencies()

This commit is contained in:
John McQuah 2023-08-21 07:52:08 -04:00
parent 507afd9766
commit e67aa2cbd3
2 changed files with 7 additions and 12 deletions

View File

@ -656,12 +656,8 @@ bool InstallTransaction::calcDependencies( )
m_missingPackages.push_back( make_pair( it->first, string("") ) );
}
}
if ( !validPackages ) {
cout << "No valid packages in this transaction" << endl;
return false;
}
if ( !calculateDependencies() ) {
if ( validPackages and (!calculateDependencies()) ) {
cout << "Could not resolve dependencies for this transaction" << endl;
return false;
}

View File

@ -519,7 +519,7 @@ void PrtGet::listInstalled() {
l.erase(mit);
InstallTransaction trans( name, m_repo, m_pkgDB, m_config );
if ( trans.calcDependencies() ) {
trans.calcDependencies();
const list<string>& depRef = trans.dependencies();
list<string>::const_iterator it = depRef.begin();
for (; it != depRef.end(); ++it) {
@ -529,7 +529,6 @@ void PrtGet::listInstalled() {
}
}
cout << name << endl;
} else { break; }
}
} else {