Commit e8d0f4b9 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Make it possible to use offline updates

Should satisfy Neon needs
parent cf301cdf
...@@ -142,9 +142,10 @@ void PackageKitUpdater::proceed() ...@@ -142,9 +142,10 @@ void PackageKitUpdater::proceed()
{ {
if (!m_proceedFunctions.isEmpty()) { if (!m_proceedFunctions.isEmpty()) {
processProceedFunction(); processProceedFunction();
} else { } else if (qEnvironmentVariableIsSet("PK_OFFLINE_UPDATE"))
setupTransaction(PackageKit::Transaction::TransactionFlagOnlyTrusted | PackageKit::Transaction::TransactionFlagOnlyDownload);
else
setupTransaction(PackageKit::Transaction::TransactionFlagOnlyTrusted); setupTransaction(PackageKit::Transaction::TransactionFlagOnlyTrusted);
}
} }
void PackageKitUpdater::start() void PackageKitUpdater::start()
...@@ -178,6 +179,9 @@ void PackageKitUpdater::finished(PackageKit::Transaction::Exit exit, uint /*time ...@@ -178,6 +179,9 @@ void PackageKitUpdater::finished(PackageKit::Transaction::Exit exit, uint /*time
setProgressing(false); setProgressing(false);
m_backend->refreshDatabase(); m_backend->refreshDatabase();
fetchLastUpdateTime(); fetchLastUpdateTime();
if (qEnvironmentVariableIsSet("PK_OFFLINE_UPDATE"))
PackageKit::Daemon::global()->offlineTrigger(PackageKit::Daemon::ActionReboot);
} }
void PackageKitUpdater::cancellableChanged() void PackageKitUpdater::cancellableChanged()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment