static int pakfire_populate_pool(struct pakfire* pakfire) {
struct pakfire_db* db;
+ struct pakfire_repo* commandline = NULL;
struct pakfire_repo* dummy = NULL;
struct pakfire_repo* system = NULL;
int r;
// Set this repository as the installed one
pool_set_installed(pool, pakfire_repo_get_repo(system));
+ // Create the command line repo
+ r = pakfire_repo_create(&commandline, pakfire, "@commandline");
+ if (r)
+ goto ERROR;
+
// Load database content
r = pakfire_db_load(db, system);
if (r)
ERROR:
if (db)
pakfire_db_unref(db);
+ if (commandline)
+ pakfire_repo_unref(commandline);
if (dummy)
pakfire_repo_unref(dummy);
if (system)
static int pakfire_request_add_archive(struct pakfire_request* request, int action,
struct pakfire_archive* archive, int extra_flags) {
- struct pakfire_repo* repo = NULL;
struct pakfire_package* package = NULL;
int r;
- r = pakfire_repo_create(&repo, request->pakfire, "@commandline");
- if (r)
- return r;
+ struct pakfire_repo* repo = pakfire_get_repo(request->pakfire, "@commandline");
+ if (!repo)
+ return 1;
// Add it to the repository
r = pakfire_repo_add_archive(repo, archive, &package);