This is useful when we simply want to add the package to a repository.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
if (r)
goto ERROR;
+ // Return the package (if requested)
+ if (package)
+ *package = pakfire_package_ref(pkg);
+
// Success!
- *package = pkg;
r = 0;
ERROR:
+ if (pkg)
+ pakfire_package_unref(pkg);
+
return r;
}
struct pakfire_repo* dummy = NULL;
int r;
- // Check inputs
- if (!package)
- return -EINVAL;
-
// Use dummy repo if no repository was passed
if (!repo) {
dummy = pakfire_get_repo(archive->pakfire, PAKFIRE_REPO_DUMMY);