|
|
|
@ -14,6 +14,7 @@
|
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
#include "source_package_publishing_history.h"
|
|
|
|
|
#include "binary_package_publishing_history.h"
|
|
|
|
|
#include "build.h"
|
|
|
|
|
#include "launchpad.h"
|
|
|
|
|
#include <iostream>
|
|
|
|
@ -91,3 +92,25 @@ const std::optional<class distro_series> source_package_publishing_history::getD
|
|
|
|
|
}
|
|
|
|
|
return std::nullopt;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::generator<binary_package_publishing_history> source_package_publishing_history::getPublishedBinaries(bool active_binaries_only) const {
|
|
|
|
|
std::map<std::string,std::string> params;
|
|
|
|
|
params["ws.op"] = "getPublishedBinaries";
|
|
|
|
|
if (active_binaries_only) params["active_binaries_only"] = "true";
|
|
|
|
|
|
|
|
|
|
auto response=lp->api_get(self_link, params);
|
|
|
|
|
if(!response) co_return;
|
|
|
|
|
auto data = nlohmann::json::parse(response.value());
|
|
|
|
|
while (true) {
|
|
|
|
|
if (data.contains("entries") && data["entries"].is_array()) {
|
|
|
|
|
for (auto &e : data["entries"]) {
|
|
|
|
|
auto bpph = binary_package_publishing_history::parse(e.dump());
|
|
|
|
|
if (bpph) { bpph->set_lp(lp); co_yield bpph.value(); }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!data.contains("next_collection_link")||data["next_collection_link"].is_null()||data["next_collection_link"]=="")break;
|
|
|
|
|
response=lp->api_get(data["next_collection_link"].get<std::string>());
|
|
|
|
|
if(!response)break;
|
|
|
|
|
data=nlohmann::json::parse(response.value());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|