// Build ID
const char* build_id = pakfire_archive_metadata_get(archive, "build", "id");
- if (build_id)
- pakfire_package_set_build_id(pkg, build_id);
+ if (build_id) {
+ r = pakfire_package_set_string(pkg, PAKFIRE_PKG_BUILD_ID, build_id);
+ if (r)
+ goto ERROR;
+ }
// Build Time
time_t build_time = pakfire_archive_metadata_get_int64(archive, "build", "time");
// Set build ID
char* build_id = pakfire_archive_get(archive, "build", "id");
if (build_id) {
- pakfire_package_set_build_id(pkg, build_id);
+ pakfire_package_set_string(pkg, PAKFIRE_PKG_BUILD_ID, build_id);
free(build_id);
}
PAKFIRE_PKG_MAINTAINER,
PAKFIRE_PKG_FILENAME,
PAKFIRE_PKG_BUILD_HOST,
+ PAKFIRE_PKG_BUILD_ID,
};
int pakfire_package_create(struct pakfire_package** package, struct pakfire* pakfire,
size_t pakfire_package_get_installsize(struct pakfire_package* pkg);
void pakfire_package_set_installsize(struct pakfire_package* pkg, size_t installsize);
size_t pakfire_package_get_size(struct pakfire_package* pkg);
-const char* pakfire_package_get_build_id(struct pakfire_package* pkg);
-void pakfire_package_set_build_id(struct pakfire_package* pkg, const char* build_id);
time_t pakfire_package_get_build_time(struct pakfire_package* pkg);
void pakfire_package_set_build_time(struct pakfire_package* pkg, time_t build_time);
time_t pakfire_package_get_install_time(struct pakfire_package* pkg);
pakfire_package_create;
pakfire_package_dump;
pakfire_package_eq;
- pakfire_package_get_build_id;
pakfire_package_get_build_time;
pakfire_package_get_cache_path;
pakfire_package_get_conflicts;
pakfire_package_get_suggests;
pakfire_package_get_supplements;
pakfire_package_ref;
- pakfire_package_set_build_id;
pakfire_package_set_build_time;
pakfire_package_set_checksum;
pakfire_package_set_downloadsize;
case PAKFIRE_PKG_BUILD_HOST:
ret = solvable_lookup_str(s, SOLVABLE_BUILDHOST);
break;
+
+ case PAKFIRE_PKG_BUILD_ID:
+ ret = solvable_lookup_str(s, SOLVABLE_BUILDVERSION);
+ break;
}
return ret;
case PAKFIRE_PKG_BUILD_HOST:
id = SOLVABLE_BUILDHOST;
break;
+
+ case PAKFIRE_PKG_BUILD_ID:
+ id = SOLVABLE_BUILDVERSION;
+ break;
}
// Check if we have found a valid ID
return pakfire_package_get_downloadsize(pkg);
}
-PAKFIRE_EXPORT const char* pakfire_package_get_build_id(struct pakfire_package* pkg) {
- return pakfire_package_get_string(pkg, SOLVABLE_BUILDVERSION);
-}
-
-PAKFIRE_EXPORT void pakfire_package_set_build_id(struct pakfire_package* pkg, const char* build_id) {
- pakfire_package_set_string(pkg, SOLVABLE_BUILDVERSION, build_id);
-}
-
void pakfire_package_set_build_id_from_uuid(struct pakfire_package* pkg, uuid_t* build_id) {
char buffer[UUID_STR_LEN];
// Convert the UUID to string
uuid_unparse_lower(*build_id, buffer);
- pakfire_package_set_build_id(pkg, buffer);
+ pakfire_package_set_string(pkg, PAKFIRE_PKG_BUILD_ID, buffer);
}
PAKFIRE_EXPORT time_t pakfire_package_get_build_time(struct pakfire_package* pkg) {
pakfire_package_dump_add_line(&string, _("UUID"), uuid);
// Build ID
- const char* build_id = pakfire_package_get_build_id(pkg);
+ const char* build_id = pakfire_package_get_string(pkg, PAKFIRE_PKG_BUILD_ID);
if (build_id)
pakfire_package_dump_add_line(&string, _("Build ID"), build_id);
}
// Write build id
- const char* build_id = pakfire_package_get_build_id(pkg);
+ const char* build_id = pakfire_package_get_string(pkg, PAKFIRE_PKG_BUILD_ID);
if (build_id) {
r = pakfire_json_add_string(pkg->pakfire, object, "id", build_id);
if (r)