Add BPackageRoster::GetActivePackages()

The implementation is temporary. Currently it reads through the packages
in the respective packages directory and checks against the package
links. Once package activation is tracked explicitly we'll use the
activation file/directory.
This commit is contained in:
Ingo Weinhold
2011-11-25 06:19:49 +01:00
parent 26265b7b4d
commit 9213e9d6a8
4 changed files with 135 additions and 1 deletions
+2
View File
@@ -0,0 +1,2 @@
#include <../os/package/PackageDefs.h>
+24
View File
@@ -0,0 +1,24 @@
/*
* Copyright 2011, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _PACKAGE__PACKAGE_DEFS_H_
#define _PACKAGE__PACKAGE_DEFS_H_
namespace BPackageKit {
enum BPackageInstallationLocation {
B_PACKAGE_INSTALLATION_LOCATION_SYSTEM,
B_PACKAGE_INSTALLATION_LOCATION_COMMON,
B_PACKAGE_INSTALLATION_LOCATION_HOME,
B_PACKAGE_INSTALLATION_LOCATION_ENUM_COUNT
};
} // namespace BPackageKit
#endif // _PACKAGE__PACKAGE_DEFS_H_
+8 -1
View File
@@ -10,6 +10,8 @@
#include <FindDirectory.h>
#include <Path.h>
#include <package/PackageDefs.h>
class BStringList;
@@ -26,6 +28,7 @@ struct BRepositoryConfigVisitor {
};
class BPackageInfoSet;
class BRepositoryCache;
class BRepositoryConfig;
@@ -56,12 +59,16 @@ public:
BRepositoryCache* repositoryCache);
status_t GetRepositoryConfig(const BString& name,
BRepositoryConfig* repositoryConfig);
status_t GetActivePackages(
BPackageInstallationLocation location,
BPackageInfoSet& packageInfos);
private:
status_t _GetRepositoryPath(BPath* path, bool create,
directory_which whichDir) const;
status_t _VisitRepositoryConfigs(const BPath& path,
BRepositoryConfigVisitor& visitor);
};