Add function to obtain bundle changes

This requires that the bundle contains a Changes.json.
This commit is contained in:
Allan Odgaard
2012-09-28 16:35:51 +02:00
parent df6c6f5f8b
commit 98b4c07083
2 changed files with 15 additions and 0 deletions

View File

@@ -587,6 +587,18 @@ namespace bundles_db
return false;
}
std::vector<std::string> release_notes (std::string const& installDir)
{
std::vector<std::string> res;
for(auto bundle : bundle_t::local_bundles(installDir))
{
std::string changes = path::join(bundle->path(), "Changes.json");
if(path::exists(changes))
res.push_back(changes);
}
return res;
}
// ===========================
// = Bundle Dependency Logic =
// ===========================

View File

@@ -75,6 +75,7 @@ namespace bundles_db
friend std::vector<bundle_ptr> index (std::string const& installDir);
friend bool update (bundle_ptr bundle, std::string const& installDir, double* progress, double min, double max);
friend bool uninstall (bundle_ptr bundle, std::string const& installDir);
friend std::vector<std::string> release_notes (std::string const& installDir);
oak::uuid_t _uuid;
@@ -135,6 +136,8 @@ namespace bundles_db
PUBLIC bool install (bundle_ptr bundle, std::string const& installDir = NULL_STR, double* progress = NULL, double min = 0, double max = 1);
PUBLIC bool uninstall (bundle_ptr bundle, std::string const& installDir = NULL_STR);
PUBLIC std::vector<std::string> release_notes (std::string const& installDir = NULL_STR);
} /* bundles_db */
#endif /* end of include guard: UPDATER_H_D2910JR4 */