int r;
// This operation is only supported for the command line repository
- if (!pakfire_repo_is_commandline(repo)) {
- errno = ENOTSUP;
- return 1;
- }
+ if (!pakfire_repo_is_commandline(repo))
+ return -ENOTSUP;
// Download the package if we got given a URL
if (pakfire_string_is_url(path)) {
// Try to open the archive
r = pakfire_archive_open(&archive, repo->pakfire, path);
- if (r)
+ if (r < 0)
goto ERROR;
// Add it to this repository
r = pakfire_repo_add_archive(repo, archive, package);
- if (r)
+ if (r < 0)
goto ERROR;
const char* nevra = pakfire_package_get_string(*package, PAKFIRE_PKG_NEVRA);
if (!nevra) {
- r = 1;
+ r = -errno;
goto ERROR;
}