handle .plasmoid upgrades in plasmapkg correctly

This commit is contained in:
Sebastian Kügler 2013-02-27 06:51:39 +01:00
parent b14ab3f1b6
commit bc80b88c66

View File

@ -156,6 +156,7 @@ void PlasmaPkg::runMain()
if (package.isValid()) { if (package.isValid()) {
serviceType = package.metadata().property("X-Plasma-ServiceType").toString(); serviceType = package.metadata().property("X-Plasma-ServiceType").toString();
} }
if (!serviceType.isEmpty()) { if (!serviceType.isEmpty()) {
if (serviceType.contains("Plasma/Applet") || if (serviceType.contains("Plasma/Applet") ||
serviceType.contains("Plasma/PopupApplet") || serviceType.contains("Plasma/PopupApplet") ||
@ -255,13 +256,14 @@ void PlasmaPkg::runMain()
//d->packageRoot = d->installer->defaultPackageRoot(); //d->packageRoot = d->installer->defaultPackageRoot();
//pluginTypes << d->installer->type(); //pluginTypes << d->installer->type();
} }
qDebug() << " 245 dp:" << d->package;
if (d->args->isSet("list")) { if (d->args->isSet("list")) {
listPackages(d->pluginTypes); listPackages(d->pluginTypes);
exit(0); exit(0);
} else { } else {
// install, remove or upgrade // install, remove or upgrade
if (!d->installer) { if (!d->installer) {
d->installer = new Plasma::Package(new Plasma::PackageStructure()); d->installer = new Plasma::Package(new Plasma::PackageStructure());
//d->installer->setServicePrefix(d->servicePrefix); //d->installer->setServicePrefix(d->servicePrefix);
} }
@ -281,7 +283,9 @@ void PlasmaPkg::runMain()
continue; continue;
} }
} }
//d->installer->setPath(d->package); if (d->args->isSet("upgrade")) {
d->installer->setPath(d->package);
}
QString _p = d->packageRoot; QString _p = d->packageRoot;
if (!_p.endsWith('/')) { if (!_p.endsWith('/')) {
_p.append('/'); _p.append('/');
@ -291,7 +295,7 @@ void PlasmaPkg::runMain()
d->metadata = d->installer->metadata(); d->metadata = d->installer->metadata();
QString pluginName; QString pluginName;
if (d->metadata.pluginName().isEmpty()) { if (!d->metadata.isValid() && d->metadata.pluginName().isEmpty()) {
// plugin name given in command line // plugin name given in command line
pluginName = d->package; pluginName = d->package;
} else { } else {