Commit ca96381a authored by Luca Giambonini's avatar Luca Giambonini

make plain and polkit upgrade operation behave the same

parent 243e4636
......@@ -266,7 +266,7 @@ void PlainUpgradeOperation::validate()
{
//NOTE: We can't just subtract sets here as the installed files already have the prefix worked in, whereas the new files don't
QSet<QString> newFiles = d->to->retrieveFiles().toSet();
QSet<QString> oldFiles = d->from->retrieveFiles().toSet();
QSet<QString> oldFiles = d->from->retrieveFiles(Package::FilepathNoPrefix).toSet();
QSet<QString> add = newFiles;
add.subtract(oldFiles);
QSet<QString> remove = oldFiles;
......
......@@ -249,6 +249,13 @@ void PolkitUpgradeOperation::validate()
add.subtract(oldFiles);
QSet<QString> remove = oldFiles;
remove.subtract(newFiles);
foreach (const QString &file, d->to->ultimatelyOwnedFiles()) {
if (QFile::exists(Config::instance()->rootDir().absoluteFilePath(file)))
add.remove(file);
}
if (!(processingOptions().testFlag(Akabei::Force))) {
setFileSystemAdditions(add.toList());
}
......
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