From 1287e9920d5004edcbf3d1d326170990fe80bccb Mon Sep 17 00:00:00 2001 From: John McQuah Date: Wed, 13 Sep 2023 12:03:07 -0400 Subject: [PATCH] respect -fr (forceRebuild) even if built package is newer than Pkgfile --- src/installtransaction.cpp | 9 +++++++-- src/prtget.cpp | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/installtransaction.cpp b/src/installtransaction.cpp index 6e14811..facf5cb 100644 --- a/src/installtransaction.cpp +++ b/src/installtransaction.cpp @@ -334,7 +334,9 @@ const { stat((portdir + "/Pkgfile").c_str(), &fstatData) == 0) { time_t pkgMtime = statData.st_mtime; time_t pfMtime = fstatData.st_mtime; - if ( difftime(pkgMtime,pfMtime) > 0 ) { cmd = "/bin/true"; } + if ( ( difftime(pkgMtime,pfMtime) > 0 ) and + (parser->pkgmkArgs().find("-fr") == string::npos) ) { + cmd = "/bin/true"; } } string args = "-d " + parser->pkgmkArgs(); @@ -378,7 +380,7 @@ const { if (update) { string from = m_pkgDB->getPackageVersion(package->name()); string to = m_repo->getPackageVersion(package->name()); - if (from == to) { + if (from == to) { summary = commandName + ": " + "reinstalling " + package->name() + " " + to; } else { @@ -463,6 +465,9 @@ 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; diff --git a/src/prtget.cpp b/src/prtget.cpp index 18152d9..46d0b29 100644 --- a/src/prtget.cpp +++ b/src/prtget.cpp @@ -950,7 +950,7 @@ void PrtGet::evaluateResult( InstallTransaction& transaction, } const list& already = transaction.alreadyInstalledPackages(); - if ( already.size() && ! m_parser->depSort() ) { + if ( already.size() ) { cout << endl << "-- Packages installed before this run (ignored)" << endl; list::const_iterator ait = already.begin(); @@ -1034,7 +1034,7 @@ void PrtGet::evaluateResult( InstallTransaction& transaction, cout << endl; - if ( errors == 0 && !interrupted ) { + if ( inst.size() && errors == 0 && !interrupted ) { cout << "prt-get: install successful." << endl; } else { m_returnValue = PG_PARTIAL_INSTALL_ERROR;