Ticket #10038: 0001-package_daemon-fix-an-issue-with-package-overwrite.patch

File 0001-package_daemon-fix-an-issue-with-package-overwrite.patch, 1.2 KB (added by throttle10, 2 years ago)
  • src/servers/package/Volume.cpp

    From 455d18d9a7abcf0d97155f432260da24319bee30 Mon Sep 17 00:00:00 2001
    From: Sergey Avilov <throttle10@protonmail.com>
    Date: Thu, 29 Jun 2017 16:16:06 +0300
    Subject: package_daemon: fix an issue with package overwrite
    
    When overwriting a package the sequence is: remove old, add new package.
    On remove we add package to ToBeDeactivated set. This is ok.
    On adding new package there is a check if package exists or not. On true
    return. But package still in ToBeDeactivated set.
    
    Fixes #10038
    ---
     src/servers/package/Volume.cpp | 6 ++++++
     1 file changed, 6 insertions(+)
    
    diff --git a/src/servers/package/Volume.cpp b/src/servers/package/Volume.cpp
    index f6ae125acf..f960f5e958 100644
    a b INFORM("Volume::_PackagesEntryCreated(\"%s\")\n", name);  
    862862                "\"%s\"\n", name);
    863863        }
    864864
     865        // Remove the package from the packages-to-be-deactivated set, if it is in
     866        // there (unlikely, unless we see a remove-create sequence).
     867        PackageSet::iterator it = fPackagesToBeDeactivated.find(package);
     868        if (it != fPackagesToBeDeactivated.end())
     869            fPackagesToBeDeactivated.erase(it);
     870
    865871        return;
    866872    }
    867873