diff options
author | Robert Griebl <robert.griebl@qt.io> | 2020-05-12 02:08:08 +0200 |
---|---|---|
committer | Robert Griebl <robert.griebl@qt.io> | 2020-05-19 11:56:35 +0200 |
commit | e27f69b78e165f90b6995d874e7aff61d40c1792 (patch) | |
tree | bbf5f88f6339ca9378047e97dbaea147f3ef253c | |
parent | 9aa86df0a664dd13b7e2b0ab350233cbe9b7a28f (diff) |
Fix "disable-installer" build
The disable-installer build-time and run-time flags have not been supported
properly since the PackageManager rewrite.
Also removed the dependency to OpenSSL for "disable-installer" builds.
Change-Id: I56e76568eca570d722631d76702776ff6bb32e21
Reviewed-by: Bernd Weimer <bernd.weimer@pelagicore.com>
-rw-r--r-- | application-manager.pro | 4 | ||||
-rw-r--r-- | doc/installation.qdoc | 7 | ||||
-rw-r--r-- | examples/applicationmanager/applicationmanager.pro | 3 | ||||
-rw-r--r-- | src/main-lib/applicationinstaller.cpp | 2 | ||||
-rw-r--r-- | src/main-lib/applicationinstaller.h | 2 | ||||
-rw-r--r-- | src/main-lib/main.cpp | 2 | ||||
-rw-r--r-- | src/manager-lib/manager-lib.pro | 4 | ||||
-rw-r--r-- | src/manager-lib/packagemanager.cpp | 279 | ||||
-rw-r--r-- | src/manager-lib/packagemanager.h | 27 | ||||
-rw-r--r-- | src/manager-lib/packagemanager_p.h | 5 | ||||
-rw-r--r-- | src/package-lib/package-lib.pro | 1 | ||||
-rw-r--r-- | src/src.pro | 6 | ||||
-rw-r--r-- | tests/tests.pro | 3 | ||||
-rw-r--r-- | util/bash/appman-prompt | 2 |
14 files changed, 210 insertions, 137 deletions
diff --git a/application-manager.pro b/application-manager.pro index df3ea34e..83b54cc5 100644 --- a/application-manager.pro +++ b/application-manager.pro @@ -32,7 +32,7 @@ load(am-config) force-single-process:force-multi-process:error("You cannot both specify force-single-process and force-multi-process") force-multi-process:!headless:!am_compatible_compositor:error("You forced multi-process mode, but the QtCompositor module is not available") -if(linux|force-libcrypto) { +!disable-installer:if(linux|force-libcrypto) { !if(contains(QT_CONFIG,"openssl")|contains(QT_CONFIG,"openssl-linked")|contains(QT_CONFIG,"ssl")):error("Qt was built without OpenSSL support.") } @@ -103,7 +103,7 @@ printConfigLine("Installer enabled", $$yesNo(!CONFIG(disable-installer)), auto) printConfigLine("Ext. DBus interfaces enabled", $$yesNo(!CONFIG(disable-external-dbus-interfaces)), auto) printConfigLine("Tests enabled", $$yesNo(CONFIG(enable-tests)), auto) printConfigLine("Examples enabled", $$yesNo(CONFIG(enable-examples)), auto) -printConfigLine("Crypto backend", $$check_crypto, auto) +!disable-installer:printConfigLine("Crypto backend", $$check_crypto, auto) printConfigLine("SSDP support", $$yesNo(qtHaveModule(pssdp)), auto) printConfigLine("Shellserver support", $$yesNo(qtHaveModule(pshellserver)), auto) printConfigLine("Genivi support", $$yesNo(qtHaveModule(geniviextras)), auto) diff --git a/doc/installation.qdoc b/doc/installation.qdoc index 20b4a2ae..8582ad61 100644 --- a/doc/installation.qdoc +++ b/doc/installation.qdoc @@ -50,10 +50,11 @@ The application manager is tested regularly on these platforms: To build the application manager with all its features, the following components are required: \list - \li \b Qt 5.9.0 or higher. + \li \b Qt 5.12.0 or higher. + + \li \b openssl \e{- Linux only and only if you need the installer functionality}. + Qt needs to be built with openssl support. The required minimum version is defined by Qt. \li \b libyaml 1.6 or higher. - \li \b openssl 1.0.1 or higher \e{- Linux only}. At compile time, only the headers need to be - available. The necessary libraries are dynamically loaded at runtime. \li \b libarchive 3.0 or higher \e{- if you need the installer functionality}. \endlist diff --git a/examples/applicationmanager/applicationmanager.pro b/examples/applicationmanager/applicationmanager.pro index 2e893fe2..5b6c5fc3 100644 --- a/examples/applicationmanager/applicationmanager.pro +++ b/examples/applicationmanager/applicationmanager.pro @@ -1,6 +1,7 @@ load(am-config) requires(!headless) +requires(!disable-installer) TEMPLATE = subdirs @@ -17,7 +18,7 @@ SUBDIRS = \ intents \ # remove the !headless and handle this in the example when we switch to the new configure system -!headless:SUBDIRS += \ +SUBDIRS += \ custom-appman \ linux:!android:SUBDIRS += \ diff --git a/src/main-lib/applicationinstaller.cpp b/src/main-lib/applicationinstaller.cpp index 0947046c..524bad2e 100644 --- a/src/main-lib/applicationinstaller.cpp +++ b/src/main-lib/applicationinstaller.cpp @@ -137,6 +137,7 @@ ApplicationInstaller::ApplicationInstaller(PackageManager *pm, QObject *parent) : QObject(parent) , m_pm(pm) { +#if !defined(AM_DISABLE_INSTALLER) // connect the APIs of the PackageManager and ApplicationInstaller QObject::connect(pm, &PackageManager::taskProgressChanged, this, &ApplicationInstaller::taskProgressChanged); @@ -177,6 +178,7 @@ ApplicationInstaller::ApplicationInstaller(PackageManager *pm, QObject *parent) }); QObject::connect(pm, &PackageManager::taskBlockingUntilInstallationAcknowledge, this, &ApplicationInstaller::taskBlockingUntilInstallationAcknowledge); +#endif } ApplicationInstaller::~ApplicationInstaller() diff --git a/src/main-lib/applicationinstaller.h b/src/main-lib/applicationinstaller.h index 0ac1096a..985d8dfd 100644 --- a/src/main-lib/applicationinstaller.h +++ b/src/main-lib/applicationinstaller.h @@ -122,6 +122,7 @@ public: }; } +#if !defined(AM_DISABLE_INSTALLER) // all QString return values are task-ids Q_SCRIPTABLE QString startPackageInstallation(const QString &installationLocationId, const QString &sourceUrl) { @@ -154,6 +155,7 @@ public: { return m_pm->activeTaskIds(); } Q_SCRIPTABLE bool cancelTask(const QString &taskId) { return m_pm->cancelTask(taskId); } +#endif // convenience function for app-store implementations Q_SCRIPTABLE int compareVersions(const QString &version1, const QString &version2) diff --git a/src/main-lib/main.cpp b/src/main-lib/main.cpp index be0931e6..033271dc 100644 --- a/src/main-lib/main.cpp +++ b/src/main-lib/main.cpp @@ -597,6 +597,8 @@ void Main::setupInstaller(const QStringList &caCertificatePaths, # endif // Q_OS_LINUX } + m_packageManager->enableInstaller(); + //TODO: this could be delayed, but needs to have a lock on the app-db in this case m_packageManager->cleanupBrokenInstallations(); diff --git a/src/manager-lib/manager-lib.pro b/src/manager-lib/manager-lib.pro index 71fad983..ded3dc07 100644 --- a/src/manager-lib/manager-lib.pro +++ b/src/manager-lib/manager-lib.pro @@ -41,6 +41,7 @@ HEADERS += \ application.h \ applicationmanager.h \ applicationmodel.h \ + asynchronoustask.h \ notificationmanager.h \ abstractcontainer.h \ containerfactory.h \ @@ -72,6 +73,7 @@ SOURCES += \ application.cpp \ applicationmanager.cpp \ applicationmodel.cpp \ + asynchronoustask.cpp \ notificationmanager.cpp \ abstractcontainer.cpp \ containerfactory.cpp \ @@ -107,14 +109,12 @@ HEADERS += ../plugin-interfaces/containerinterface.h appman_crypto-private \ HEADERS += \ - asynchronoustask.h \ deinstallationtask.h \ installationtask.h \ scopeutilities.h \ sudo.h \ SOURCES += \ - asynchronoustask.cpp \ installationtask.cpp \ deinstallationtask.cpp \ scopeutilities.cpp \ diff --git a/src/manager-lib/packagemanager.cpp b/src/manager-lib/packagemanager.cpp index 932b57ed..8ae65d1a 100644 --- a/src/manager-lib/packagemanager.cpp +++ b/src/manager-lib/packagemanager.cpp @@ -321,12 +321,19 @@ QObject *PackageManager::instanceForQml(QQmlEngine *, QJSEngine *) return instance(); } +void PackageManager::enableInstaller() +{ +#if !defined(AM_DISABLE_INSTALLER) + d->disableInstaller = false; +#endif +} + void PackageManager::registerPackages() { qCDebug(LogSystem) << "Registering packages:"; // collect all updates to builtin first, so we can avoid re-creating a lot of objects, - // if we find an update to a builin app later on + // if we find an update to a builtin app later on QMap<QString, QPair<PackageInfo *, PackageInfo *>> pkgs; // map all the built-in packages first @@ -699,13 +706,17 @@ uint PackageManager::commonApplicationGroupId() const bool PackageManager::enableApplicationUserIdSeparation(uint minUserId, uint maxUserId, uint commonGroupId) { - if (minUserId >= maxUserId || minUserId == uint(-1) || maxUserId == uint(-1)) + if (minUserId >= maxUserId || minUserId == uint(-1) || maxUserId == uint(-1) || commonGroupId == uint(-1)) return false; +#if !defined(AM_DISABLE_INSTALLER) d->userIdSeparation = true; d->minUserId = minUserId; d->maxUserId = maxUserId; d->commonGroupId = commonGroupId; return true; +#else + return false; +#endif } uint PackageManager::findUnusedUserId() const Q_DECL_NOEXCEPT_EXPR(false) @@ -820,6 +831,7 @@ QVariantMap PackageManager::documentLocation() const void PackageManager::cleanupBrokenInstallations() Q_DECL_NOEXCEPT_EXPR(false) { +#if !defined(AM_DISABLE_INSTALLER) // Check that everything in the app-db is available // -> if not, remove from app-db @@ -908,6 +920,7 @@ void PackageManager::cleanupBrokenInstallations() Q_DECL_NOEXCEPT_EXPR(false) } } } +#endif // !defined(AM_DISABLE_INSTALLER) } /*! @@ -995,7 +1008,11 @@ QString PackageManager::startPackageInstallation(const QUrl &sourceUrl) { AM_TRACE(LogInstaller, sourceUrl) - return enqueueTask(new InstallationTask(d->installationPath, d->documentPath, sourceUrl)); +#if !defined(AM_DISABLE_INSTALLER) + if (!d->disableInstaller) + return enqueueTask(new InstallationTask(d->installationPath, d->documentPath, sourceUrl)); +#endif + return QString(); } /*! @@ -1040,14 +1057,18 @@ void PackageManager::acknowledgePackageInstallation(const QString &taskId) { AM_TRACE(LogInstaller, taskId) - const auto allTasks = d->allTasks(); +#if !defined(AM_DISABLE_INSTALLER) + if (!d->disableInstaller) { + const auto allTasks = d->allTasks(); - for (AsynchronousTask *task : allTasks) { - if (qobject_cast<InstallationTask *>(task) && (task->id() == taskId)) { - static_cast<InstallationTask *>(task)->acknowledge(); - break; + for (AsynchronousTask *task : allTasks) { + if (qobject_cast<InstallationTask *>(task) && (task->id() == taskId)) { + static_cast<InstallationTask *>(task)->acknowledge(); + break; + } } } +#endif } /*! @@ -1068,12 +1089,16 @@ void PackageManager::acknowledgePackageInstallation(const QString &taskId) */ QString PackageManager::removePackage(const QString &packageId, bool keepDocuments, bool force) { - AM_TRACE(LogInstaller, packageId, keepDocuments) + AM_TRACE(LogInstaller, packageId, keepDocuments, force) - if (Package *package = fromId(packageId)) { - return enqueueTask(new DeinstallationTask(package, d->installationPath, - d->documentPath, force, keepDocuments)); +#if !defined(AM_DISABLE_INSTALLER) + if (!d->disableInstaller) { + if (Package *package = fromId(packageId)) { + return enqueueTask(new DeinstallationTask(package, d->installationPath, + d->documentPath, force, keepDocuments)); + } } +#endif return QString(); } @@ -1088,12 +1113,18 @@ QString PackageManager::removePackage(const QString &packageId, bool keepDocumen */ AsynchronousTask::TaskState PackageManager::taskState(const QString &taskId) const { - const auto allTasks = d->allTasks(); +#if !defined(AM_DISABLE_INSTALLER) + if (!d->disableInstaller) { + const auto allTasks = d->allTasks(); - for (const AsynchronousTask *task : allTasks) { - if (task && (task->id() == taskId)) - return task->state(); + for (const AsynchronousTask *task : allTasks) { + if (task && (task->id() == taskId)) + return task->state(); + } } +#else + Q_UNUSED(taskId) +#endif return AsynchronousTask::Invalid; } @@ -1109,12 +1140,18 @@ AsynchronousTask::TaskState PackageManager::taskState(const QString &taskId) con */ QString PackageManager::taskPackageId(const QString &taskId) const { - const auto allTasks = d->allTasks(); +#if !defined(AM_DISABLE_INSTALLER) + if (!d->disableInstaller) { + const auto allTasks = d->allTasks(); - for (const AsynchronousTask *task : allTasks) { - if (task && (task->id() == taskId)) - return task->packageId(); + for (const AsynchronousTask *task : allTasks) { + if (task && (task->id() == taskId)) + return task->packageId(); + } } +#else + Q_UNUSED(taskId) +#endif return QString(); } @@ -1125,11 +1162,15 @@ QString PackageManager::taskPackageId(const QString &taskId) const */ QStringList PackageManager::activeTaskIds() const { - const auto allTasks = d->allTasks(); - QStringList result; - for (const AsynchronousTask *task : allTasks) - result << task->id(); +#if !defined(AM_DISABLE_INSTALLER) + if (!d->disableInstaller) { + const auto allTasks = d->allTasks(); + + for (const AsynchronousTask *task : allTasks) + result << task->id(); + } +#endif return result; } @@ -1144,103 +1185,37 @@ bool PackageManager::cancelTask(const QString &taskId) { AM_TRACE(LogInstaller, taskId) - // incoming tasks can be forcefully canceled right away - for (AsynchronousTask *task : qAsConst(d->incomingTaskList)) { - if (task->id() == taskId) { - task->forceCancel(); - task->deleteLater(); +#if !defined(AM_DISABLE_INSTALLER) + if (!d->disableInstaller) { + // incoming tasks can be forcefully canceled right away + for (AsynchronousTask *task : qAsConst(d->incomingTaskList)) { + if (task->id() == taskId) { + task->forceCancel(); + task->deleteLater(); - handleFailure(task); + handleFailure(task); - d->incomingTaskList.removeOne(task); - triggerExecuteNextTask(); - return true; + d->incomingTaskList.removeOne(task); + triggerExecuteNextTask(); + return true; + } } - } - // the active task and async tasks might be in a state where cancellation is not possible, - // so we have to ask them nicely - if (d->activeTask && d->activeTask->id() == taskId) - return d->activeTask->cancel(); + // the active task and async tasks might be in a state where cancellation is not possible, + // so we have to ask them nicely + if (d->activeTask && d->activeTask->id() == taskId) + return d->activeTask->cancel(); - for (AsynchronousTask *task : qAsConst(d->installationTaskList)) { - if (task->id() == taskId) - return task->cancel(); + for (AsynchronousTask *task : qAsConst(d->installationTaskList)) { + if (task->id() == taskId) + return task->cancel(); + } } +#endif return false; } -/*! - \qmlmethod int PackageManager::compareVersions(string version1, string version2) - - Convenience method for app-store implementations or taskRequestingInstallationAcknowledge() - callbacks for comparing version numbers, as the actual version comparison algorithm is not - trivial. - - Returns \c -1, \c 0 or \c 1 if \a version1 is smaller than, equal to, or greater than \a - version2 (similar to how \c strcmp() works). -*/ -int PackageManager::compareVersions(const QString &version1, const QString &version2) -{ - int vn1Suffix = -1; - int vn2Suffix = -1; - QVersionNumber vn1 = QVersionNumber::fromString(version1, &vn1Suffix); - QVersionNumber vn2 = QVersionNumber::fromString(version2, &vn2Suffix); - - int d = QVersionNumber::compare(vn1, vn2); - return d < 0 ? -1 : (d > 0 ? 1 : version1.mid(vn1Suffix).compare(version2.mid(vn2Suffix))); -} - -/*! - \qmlmethod int PackageManager::validateDnsName(string name, int minimalPartCount) - - Convenience method for app-store implementations or taskRequestingInstallationAcknowledge() - callbacks for checking if the given \a name is a valid DNS (or reverse-DNS) name according to - RFC 1035/1123. If the optional parameter \a minimalPartCount is specified, this function will - also check if \a name contains at least this amount of parts/sub-domains. - - Returns \c true if the name is a valid DNS name or \c false otherwise. -*/ -bool PackageManager::validateDnsName(const QString &name, int minimalPartCount) -{ - try { - // check if we have enough parts: e.g. "tld.company.app" would have 3 parts - QStringList parts = name.split('.'); - if (parts.size() < minimalPartCount) { - throw Exception(Error::Parse, "the minimum amount of parts (subdomains) is %1 (found %2)") - .arg(minimalPartCount).arg(parts.size()); - } - - // standard RFC compliance tests (RFC 1035/1123) - - auto partCheck = [](const QString &part) { - int len = part.length(); - - if (len < 1 || len > 63) - throw Exception(Error::Parse, "domain parts must consist of at least 1 and at most 63 characters (found %2 characters)").arg(len); - - for (int pos = 0; pos < len; ++pos) { - ushort ch = part.at(pos).unicode(); - bool isFirst = (pos == 0); - bool isLast = (pos == (len - 1)); - bool isDash = (ch == '-'); - bool isDigit = (ch >= '0' && ch <= '9'); - bool isLower = (ch >= 'a' && ch <= 'z'); - - if ((isFirst || isLast || !isDash) && !isDigit && !isLower) - throw Exception(Error::Parse, "domain parts must consist of only the characters '0-9', 'a-z', and '-' (which cannot be the first or last character)"); - } - }; - - for (const QString &part : parts) - partCheck(part); - - return true; - } catch (const Exception &e) { - qCDebug(LogInstaller).noquote() << "validateDnsName failed:" << e.errorString(); - return false; - } -} +#if !defined(AM_DISABLE_INSTALLER) QString PackageManager::enqueueTask(AsynchronousTask *task) { @@ -1251,7 +1226,7 @@ QString PackageManager::enqueueTask(AsynchronousTask *task) void PackageManager::triggerExecuteNextTask() { - if (!QMetaObject::invokeMethod(this, "executeNextTask", Qt::QueuedConnection)) + if (!QMetaObject::invokeMethod(this, &PackageManager::executeNextTask, Qt::QueuedConnection)) qCCritical(LogSystem) << "ERROR: failed to invoke method checkQueue"; } @@ -1337,6 +1312,9 @@ void PackageManager::handleFailure(AsynchronousTask *task) emit taskFailed(task->id(), int(task->errorCode()), task->errorString()); } +#endif // !defined(AM_DISABLE_INSTALLER) + + bool PackageManager::startingPackageInstallation(PackageInfo *info) { // ownership of info is transferred to PackageManager @@ -1520,11 +1498,86 @@ bool PackageManager::canceledPackageInstall(const QString &id) return true; } + +/*! + \qmlmethod int PackageManager::compareVersions(string version1, string version2) + + Convenience method for app-store implementations or taskRequestingInstallationAcknowledge() + callbacks for comparing version numbers, as the actual version comparison algorithm is not + trivial. + + Returns \c -1, \c 0 or \c 1 if \a version1 is smaller than, equal to, or greater than \a + version2 (similar to how \c strcmp() works). +*/ +int PackageManager::compareVersions(const QString &version1, const QString &version2) +{ + int vn1Suffix = -1; + int vn2Suffix = -1; + QVersionNumber vn1 = QVersionNumber::fromString(version1, &vn1Suffix); + QVersionNumber vn2 = QVersionNumber::fromString(version2, &vn2Suffix); + + int d = QVersionNumber::compare(vn1, vn2); + return d < 0 ? -1 : (d > 0 ? 1 : version1.mid(vn1Suffix).compare(version2.mid(vn2Suffix))); +} + +/*! + \qmlmethod int PackageManager::validateDnsName(string name, int minimalPartCount) + + Convenience method for app-store implementations or taskRequestingInstallationAcknowledge() + callbacks for checking if the given \a name is a valid DNS (or reverse-DNS) name according to + RFC 1035/1123. If the optional parameter \a minimalPartCount is specified, this function will + also check if \a name contains at least this amount of parts/sub-domains. + + Returns \c true if the name is a valid DNS name or \c false otherwise. +*/ +bool PackageManager::validateDnsName(const QString &name, int minimalPartCount) +{ + try { + // check if we have enough parts: e.g. "tld.company.app" would have 3 parts + QStringList parts = name.split('.'); + if (parts.size() < minimalPartCount) { + throw Exception(Error::Parse, "the minimum amount of parts (subdomains) is %1 (found %2)") + .arg(minimalPartCount).arg(parts.size()); + } + + // standard RFC compliance tests (RFC 1035/1123) + + auto partCheck = [](const QString &part) { + int len = part.length(); + + if (len < 1 || len > 63) + throw Exception(Error::Parse, "domain parts must consist of at least 1 and at most 63 characters (found %2 characters)").arg(len); + + for (int pos = 0; pos < len; ++pos) { + ushort ch = part.at(pos).unicode(); + bool isFirst = (pos == 0); + bool isLast = (pos == (len - 1)); + bool isDash = (ch == '-'); + bool isDigit = (ch >= '0' && ch <= '9'); + bool isLower = (ch >= 'a' && ch <= 'z'); + + if ((isFirst || isLast || !isDash) && !isDigit && !isLower) + throw Exception(Error::Parse, "domain parts must consist of only the characters '0-9', 'a-z', and '-' (which cannot be the first or last character)"); + } + }; + + for (const QString &part : parts) + partCheck(part); + + return true; + } catch (const Exception &e) { + qCDebug(LogInstaller).noquote() << "validateDnsName failed:" << e.errorString(); + return false; + } +} + bool removeRecursiveHelper(const QString &path) { +#if !defined(AM_DISABLE_INSTALLER) if (PackageManager::instance()->isApplicationUserIdSeparationEnabled() && SudoClient::instance()) return SudoClient::instance()->removeRecursive(path); else +#endif return recursiveOperation(path, safeRemove); } diff --git a/src/manager-lib/packagemanager.h b/src/manager-lib/packagemanager.h index 918de38a..77d702be 100644 --- a/src/manager-lib/packagemanager.h +++ b/src/manager-lib/packagemanager.h @@ -48,8 +48,10 @@ #include <QtAppManCommon/global.h> #include <QtAppManApplication/packageinfo.h> #include <QtAppManManager/asynchronoustask.h> -#include <QtAppManManager/installationtask.h> -#include <QtAppManManager/deinstallationtask.h> +#if !defined(AM_DISABLE_INSTALLER) +# include <QtAppManManager/installationtask.h> +# include <QtAppManManager/deinstallationtask.h> +#endif QT_FORWARD_DECLARE_CLASS(QQmlEngine) @@ -109,6 +111,7 @@ public: static PackageManager *instance(); static QObject *instanceForQml(QQmlEngine *qmlEngine, QJSEngine *); + void enableInstaller(); void registerPackages(); QVector<Package *> packages() const; @@ -194,15 +197,21 @@ signals: const QVariantMap &packageExtraSignedMetaData); Q_SCRIPTABLE void taskBlockingUntilInstallationAcknowledge(const QString &taskId); -private slots: - void executeNextTask(); - protected: + bool startingPackageInstallation(PackageInfo *info); bool startingPackageRemoval(const QString &id); bool finishedPackageInstall(const QString &id); bool canceledPackageInstall(const QString &id); +#if !defined(AM_DISABLE_INSTALLER) +private: + void executeNextTask(); + void triggerExecuteNextTask(); + QString enqueueTask(AsynchronousTask *task); + void handleFailure(AsynchronousTask *task); +#endif + private: void emitDataChanged(Package *package, const QVector<int> &roles = QVector<int>()); void registerPackage(PackageInfo *packageInfo, PackageInfo *updatedPackageInfo, @@ -210,16 +219,10 @@ private: void registerApplicationsAndIntentsOfPackage(Package *package); void unregisterApplicationsAndIntentsOfPackage(Package *package); static void registerQmlTypes(); - - void triggerExecuteNextTask(); - QString enqueueTask(AsynchronousTask *task); - void handleFailure(AsynchronousTask *task); - QList<QByteArray> caCertificates() const; - -private: uint findUnusedUserId() const Q_DECL_NOEXCEPT_EXPR(false); +private: explicit PackageManager(PackageDatabase *packageDatabase, const QString &documentPath); PackageManager(const PackageManager &); diff --git a/src/manager-lib/packagemanager_p.h b/src/manager-lib/packagemanager_p.h index b841a3c1..3c5d61ef 100644 --- a/src/manager-lib/packagemanager_p.h +++ b/src/manager-lib/packagemanager_p.h @@ -66,6 +66,11 @@ public: QMap<Package *, PackageInfo *> pendingPackageInfoUpdates; +#if defined(AM_DISABLE_INSTALLER) + static constexpr +#endif + bool disableInstaller = true; + bool developmentMode = false; bool allowInstallationOfUnsignedPackages = false; bool userIdSeparation = false; diff --git a/src/package-lib/package-lib.pro b/src/package-lib/package-lib.pro index 056649c2..ccee057a 100644 --- a/src/package-lib/package-lib.pro +++ b/src/package-lib/package-lib.pro @@ -7,7 +7,6 @@ load(am-config) QT = core network QT_FOR_PRIVATE *= \ appman_common-private \ - appman_crypto-private \ appman_application-private \ CONFIG *= static internal_module diff --git a/src/src.pro b/src/src.pro index 5b6867bd..a47aa209 100644 --- a/src/src.pro +++ b/src/src.pro @@ -17,7 +17,7 @@ notification_lib.subdir = notification-lib notification_lib.depends = common_lib package_lib.subdir = package-lib -package_lib.depends = crypto_lib application_lib +package_lib.depends = application_lib manager_lib.subdir = manager-lib manager_lib.depends = application_lib notification_lib intent_server_lib intent_client_lib monitor_lib plugin_interfaces @@ -74,10 +74,12 @@ tools_controller.depends = common_lib SUBDIRS = \ common_lib \ - crypto_lib \ application_lib \ package_lib \ +!disable-installer:SUBDIRS += \ + crypto_lib + !tools-only { SUBDIRS += \ plugin_interfaces \ diff --git a/tests/tests.pro b/tests/tests.pro index d71a422e..5fcee825 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -1,5 +1,8 @@ TEMPLATE = subdirs +load(am-config) +requires(!disable-installer) + SUBDIRS = \ manual \ application \ diff --git a/util/bash/appman-prompt b/util/bash/appman-prompt index 1776377b..5c4f3574 100644 --- a/util/bash/appman-prompt +++ b/util/bash/appman-prompt @@ -33,7 +33,7 @@ _appman() COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" opts="--app-image-mount-dir --build-config --builtin-apps-manifest-dir -c --clear-cache --config-file \ ---database --dbus --force-multi-process --force-single-process --fullscreen --help -I \ +--database --dbus --disable-installer --force-multi-process --force-single-process --fullscreen --help -I \ --installed-apps-manifest-dir --load-dummydata --log-instant --logging-rule --no-cache --no-dlt-logging \ --no-fullscreen --no-security --no-ui-watchdog -o --option --qml-debug --single-app \ --slow-animations --verbose --version --wayland-socket-name" |