- strcpy(url, archive_url);
- strcat(url, QUERY_GET_PUBLISHED_BINARIES);
+ n = strlen(archive_url) + strlen(default_opt) + 3 + 1;
+
+ if (status)
+ n += strlen(status_opt) + strlen(status);
+
+ url = malloc(n);
+ sprintf(url, "%s%s%d", archive_url, default_opt, size);
+
+ if (status) {
+ strcat(url, status_opt);
+ strcat(url, status);
+ }
+
+ return url;
+}
+
+struct bpph **get_bpph_list(const char *archive_url,
+ const char *pkg_status,
+ int ws_size)
+{
+ char *url, *key, *tmp;
+ struct bpph **result;
+ struct json_object *o, *bpph_json, *o_next;
+ char *date;
+ int ok;
+
+ url = create_query_get_bpph(archive_url, pkg_status, ws_size);
+
+ key = get_bpph_list_cache_key(archive_url);
+
+ result = get_bpph_list_from_cache(key);
+
+ if (result) {
+ date = get_last_creation_date(result);
+
+ if (date) {
+ printf("Update package since: %s\n", date);