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:
@@ -0,0 +1,2 @@
|
||||
#include <../os/package/PackageDefs.h>
|
||||
|
||||
@@ -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_
|
||||
@@ -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);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user