[haiku-commits] haiku: hrev46232 - src/apps/haiku-depot

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 15 Oct 2013 05:49:53 +0200 (CEST)

hrev46232 adds 1 changeset to branch 'master'
old head: abfe23dcf33fc8172f5deb50980ff6c6c8fd8a53
new head: 8035a8406cb4c1b0d73f265819961630610fb08c
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=8035a84+%5Eabfe23d

----------------------------------------------------------------------------

8035a84: Fix #10100.
  
  - If a package is already installed, look up its installed location and
    use that when initializing the package manager for uninstallation,
    otherwise we'd potentially fail to find the package, and consequently
    fail to remove it.

                                         [ Rene Gollent <rene@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev46232
Commit:      8035a8406cb4c1b0d73f265819961630610fb08c
URL:         http://cgit.haiku-os.org/haiku/commit/?id=8035a84
Author:      Rene Gollent <rene@xxxxxxxxxxx>
Date:        Tue Oct 15 03:47:08 2013 UTC

Ticket:      https://dev.haiku-os.org/ticket/10100

----------------------------------------------------------------------------

1 file changed, 12 insertions(+), 1 deletion(-)
src/apps/haiku-depot/PackageAction.cpp | 13 ++++++++++++-

----------------------------------------------------------------------------

diff --git a/src/apps/haiku-depot/PackageAction.cpp 
b/src/apps/haiku-depot/PackageAction.cpp
index 913dc0d..e812bb8 100644
--- a/src/apps/haiku-depot/PackageAction.cpp
+++ b/src/apps/haiku-depot/PackageAction.cpp
@@ -22,9 +22,20 @@ PackageAction::PackageAction(int32 type, PackageInfoRef 
package, Model* model)
        fType(type),
        fModel(model)
 {
+       const PackageInstallationLocationSet& locations
+               = package->InstallationLocations();
+
+       int32 location = B_PACKAGE_INSTALLATION_LOCATION_HOME;
+       // if the package is already installed, use its first installed location
+       // to initialize the manager.
+       // TODO: ideally if the package is installed at multiple locations,
+       // the user should be able to pick which one to remove.
+       if (locations.size() != 0)
+               location = *locations.begin();
+
        // TODO: allow configuring the installation location
        fPackageManager = new(std::nothrow) PackageManager(
-               B_PACKAGE_INSTALLATION_LOCATION_HOME);
+               (BPackageInstallationLocation)location);
 }
 
 


Other related posts:

  • » [haiku-commits] haiku: hrev46232 - src/apps/haiku-depot - anevilyak