// Fetch the local repository & import the archive
local = pakfire_get_repo(pakfire, PAKFIRE_REPO_LOCAL);
if (local) {
- r = pakfire_repo_import_archive(local, archive);
+ r = pakfire_repo_import_archive(local, archive, NULL);
if (r < 0) {
ERROR(ctx, "Could not import %s to the local repository: %s\n",
nevra, strerror(-r));
goto ERROR;
// Import the package into the repository
- r = pakfire_repo_import_archive(build->repo, archive);
+ r = pakfire_repo_import_archive(build->repo, archive, NULL);
if (r < 0)
goto ERROR;
return pakfire_archive_make_package(archive, repo, package);
}
-int pakfire_repo_import_archive(struct pakfire_repo* self, struct pakfire_archive* archive) {
+int pakfire_repo_import_archive(struct pakfire_repo* self,
+ struct pakfire_archive* archive, struct pakfire_package** package) {
struct pakfire_package* pkg = NULL;
const char* uuid = NULL;
char relpath[PATH_MAX];
// XXX REMOVE THE PACKAGE METDATA FROM THIS REPOSITORY
END:
+ // Return the package if requested
+ if (package)
+ *package = pakfire_package_ref(pkg);
+
if (pkg)
pakfire_package_unref(pkg);
}
// Import the archive
- r = pakfire_repo_import_archive(repo, archive);
+ r = pakfire_repo_import_archive(repo, archive, NULL);
if (r < 0) {
ERROR(ctx, "Could not import %s: %s\n", *file, strerror(-r));
goto OUT;
int pakfire_repo_add_archive(struct pakfire_repo* repo,
struct pakfire_archive* archive, struct pakfire_package** package);
-int pakfire_repo_import_archive(struct pakfire_repo* self, struct pakfire_archive* archive);
+int pakfire_repo_import_archive(struct pakfire_repo* self,
+ struct pakfire_archive* archive, struct pakfire_package** package);
int pakfire_repo_download_package(struct pakfire_xfer** xfer,
struct pakfire_repo* repo, struct pakfire_package* pkg);