const char* pakfire_get_distro_tag(struct pakfire* pakfire) {
int r;
- if (*pakfire->distro.tag)
- return pakfire->distro.tag;
-
- const char* id = pakfire_get_distro_id(pakfire);
- const char* version_id = pakfire_get_distro_version_id(pakfire);
-
- // Break if the configuration is incomplete
- if (!id || !version_id) {
- errno = EINVAL;
- return NULL;
+ // Generate the tag
+ if (!*pakfire->distro.tag) {
+ r = pakfire_string_format(pakfire->distro.tag,
+ "%s%s", pakfire->distro.id, pakfire->distro.version_id);
+ if (r < 0) {
+ errno = -r;
+ return NULL;
+ }
}
- // Format string
- r = pakfire_string_format(pakfire->distro.tag, "%s%s", id, version_id);
- if (r < 0)
- return NULL;
-
- // Return the tag
return pakfire->distro.tag;
}
if (*p->distro.slogan)
CTX_DEBUG(p->ctx, " slogan = %s\n", p->distro.slogan);
+ // Check if the distribution has been configured
+ if (!*p->distro.id || !*p->distro.version_id) {
+ CTX_ERROR(p->ctx, "Invalid distribution configuration\n");
+ r = -EINVAL;
+ goto ERROR;
+ }
+
// Bump RLIMIT_NOFILE to maximum
r = pakfire_rlimit_set(p, PAKFIRE_RLIMIT_NOFILE_MAX);
if (r)