void ContainerManagerWorker:: run() { switch(container_action_) { case ContainerAction::Create: createContainer(data_); break; case ContainerAction::Destroy: destroyContainer(); break; case ContainerAction::Install: installPackage(data_); break; case ContainerAction::Remove: removePackage(data_); break; case ContainerAction::Update: updateContainer(); break; default: break; } }
void installPackageCocos2DX() { // Register some bindings for Cocos. LOOM_DECLARE_NATIVETYPE(LoomCocos2d, registerCocos2D); installPackage(); }
bool PackageJobThread::update(const QString &src, const QString &dest) { bool ok = installPackage(src, dest, Update); emit installPathChanged(d->installPath); emit finished(ok, d->errorMessage); return ok; }
/*! \internal Install the unzipped widgets at \a source to \a target. The Unique ID is given as \a appId. */ WidgetInstallerPrivate::InstallationStatus WidgetInstallerPrivate::install(QString source, QString target, QString appId) { WBM("Maemo specific installation"); m_appId = appId; m_packageName = m_appId + "-wrt-widget"; QStringList arguments = QCoreApplication::arguments(); for (int i = 0; i < arguments.size(); ++i) { if (arguments.at(i) == "--path") { if(i+1 < arguments.size()) m_outputPath = arguments.at(i+1); } else if (arguments.at(i) == "--ovi-productid") { if(i + 1 < arguments.size()) { m_productId = arguments.at(i+1); m_packageName = OVISTORE_WEBAPPS_PACKAGE_NAME_PREFIX + m_productId; } } } m_installationPath = target; if (!m_installationPath.endsWith(QDir::separator())) m_installationPath.append(QDir::separator()); #if defined(Q_OS_MAEMO5) || defined(Q_OS_MAEMO6) m_packageUtils = new DebianUtils(m_widget, m_packageName, source, m_installationPath, m_appId); #if ENABLE(AEGIS_LOCALSIG) //If coming from from trusted zone set the the flag to true for the //debian utils and it will create the local signature if (m_widget->getWidgetType() == WidgetTypeW3c || m_widget->getWidgetType() == WidgetTypeJIL) { WgtWidget* wgtwidget = static_cast<WgtWidget*>(m_widget); if (wgtwidget && wgtwidget->isFromTrustedDomain()) { static_cast<DebianUtils*>(m_packageUtils)->installFromTrustedOrigin(true); } } #endif //AEGIS_LOCALSIG #elif defined(Q_OS_MEEGO) m_packageUtils = new RpmUtils(m_widget, m_packageName, source, m_installationPath, m_appId); #else // TODO: fix for other platforms #endif #if defined(Q_OS_MAEMO6) if(m_userCancelled) return OperationCancelled; #endif if (!m_packageUtils->createPackage()) { qCritical() << "Couldn't create package"; emit m_widget->installationError(WidgetPlatformSpecificInstallFailed); return PackageCreationFailed; } #if defined(Q_OS_MAEMO6) QCoreApplication::processEvents(); if(m_userCancelled) return OperationCancelled; m_packageManager = new PackageManager(); #endif int pathIndex = arguments.indexOf("--installation-info-file") + 1; if (pathIndex) { QFile file(arguments.at(pathIndex)); if (file.open(QIODevice::WriteOnly | QIODevice::Text)) { QTextStream out(&file); out << "debcreated: " << m_packageUtils->packageFilePath() << "\n"; out << "installpath: " << m_installationPath; file.close(); } else qCritical() << "Could not open infofile (" << arguments.at(pathIndex) << ") for writing"; } if (m_outputPath.isEmpty() && m_noInstall) m_outputPath = QDir::currentPath(); if (!m_outputPath.isEmpty()) { if (!hasEnoughSpace(m_packageUtils->packageFilePath(), m_outputPath)) { qCritical() << "Not enough space"; emit m_widget->installationError(WidgetInsufficientDiskSpace); return NotEnoughSpace; } m_outputPath.append(QDir::separator() + m_packageUtils->packageFileName()); if (QFile::exists(m_outputPath)) QFile::remove(m_outputPath); if (!QFile::rename(m_packageUtils->packageFilePath(), m_outputPath)) { qCritical() << "Couldn't move the package"; emit m_widget->installationError(WidgetPlatformSpecificInstallFailed); return PackageMovingFailed; } return Success; } #if defined(Q_OS_MAEMO6) QCoreApplication::processEvents(); if(m_userCancelled) { return OperationCancelled; } #endif if (!installPackage()) { #if defined(Q_OS_MAEMO6) if (m_userCancelled) return OperationCancelled; #endif qCritical() << "Couldn't install Debian package"; return PackageInstallationFailed; } return Success; }
bool TostPack::installPackage(string packageName) { return installPackage(GIT, TostPack::officialGitRepositoryUrl + packageName); }