Commit f0ad8216 authored by Lukas Appelhans's avatar Lukas Appelhans

Multiple fixes

parent 5846aaf7
......@@ -217,6 +217,16 @@ int main(int argc, char** argv)
}
} else if (args->isSet("U")) {
type = APM::UpgradeOperationType;
if (args->isSet("asdeps"))
list.append(APM::AsDeps);
if (args->isSet("asexplicit"))
list.append(APM::AsExplicit);
if (args->isSet("d"))
list.append(APM::SkipDependencyCheck);
if (args->isSet("f"))
list.append(APM::Force);
if (args->isSet("w"))
list.append(APM::DownloadOnly);
} else {
fprintf(stderr, "Please select an operation to do!\nCall akabei --help for explanation.\n");
return app.exec();
......
......@@ -56,10 +56,12 @@ void RemoveOperation::start(QList<APM::Operation> operations, QMultiHash<APM::Op
removeRecursive(Akabei::Backend::instance()->localDatabase()->queryPackages(query));
else
remove(Akabei::Backend::instance()->localDatabase()->queryPackages(query));
} else {
} else if (!m_operations.isEmpty()) {
QList<APM::Operation> ops = operations;
ops.removeFirst();
start(ops, options, args);
} else {
QCoreApplication::instance()->quit();
}
}
......
......@@ -142,6 +142,7 @@ void SyncOperation::upgrade(QUuid , QList< Akabei::Package* > packages)
void SyncOperation::install(QUuid , QList< Akabei::Package* > packages)
{
//FIXME: Cleanup and show all the packages and what is going to be done with them!
QTextStream out(stdout);
QMap<QString, Akabei::Package*> toBeInstalled;
QMap<QString, Akabei::Package*> local;
......@@ -154,8 +155,12 @@ void SyncOperation::install(QUuid , QList< Akabei::Package* > packages)
//if (local[pkg->name()])
// toBeInstalled << local[pkg->name()];
//else
if (!toBeInstalled[pkg->name()] || toBeInstalled[pkg->name()]->version() < pkg->version())
if (!toBeInstalled[pkg->name()] || toBeInstalled[pkg->name()]->version() < pkg->version()) {
toBeInstalled[pkg->name()] = pkg;
if (local.contains(pkg->name()) && (pkg->version() > local[pkg->name()]->version())) {
local.remove(pkg->name());
}
}
}
}
if (!toBeInstalled.count())
......
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