return 0;
}
-static int pakfire_read_os_release(struct pakfire* pakfire) {
- char path[PATH_MAX];
+static int pakfire_read_os_release(struct pakfire* pakfire, const char* path) {
+ char file[PATH_MAX];
int r;
// Compose path
- r = pakfire_path(pakfire, path, "%s", "/etc/os-release");
+ r = pakfire_path_append(file, path, "/etc/os-release");
if (r < 0)
return r;
// Read the distro
- r = pakfire_distro(&pakfire->distro, path);
+ r = pakfire_distro(&pakfire->distro, file);
if (r < 0) {
switch (-r) {
case ENOENT:
return 0;
default:
+ CTX_ERROR(pakfire->ctx, "Could not read /etc/os-release: %s\n", strerror(-r));
break;
}
}
// Read /etc/os-release
if (p->internal_flags & PAKFIRE_HAS_PATH) {
- r = pakfire_read_os_release(p);
+ r = pakfire_read_os_release(p, path);
if (r < 0)
goto ERROR;