diff options
Diffstat (limited to 'src/pacman')
-rw-r--r-- | src/pacman/package.c | 7 | ||||
-rw-r--r-- | src/pacman/package.h | 9 | ||||
-rw-r--r-- | src/pacman/query.c | 4 | ||||
-rw-r--r-- | src/pacman/sync.c | 4 |
4 files changed, 8 insertions, 16 deletions
diff --git a/src/pacman/package.c b/src/pacman/package.c index a8c15eb8..5654944c 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -61,7 +61,7 @@ static void deplist_display(const char *title, * @param from the type of package we are dealing with * @param extra should we show extra information */ -void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra) +void dump_pkg_full(alpm_pkg_t *pkg, int extra) { const char *reason; time_t bdate, idate; @@ -69,10 +69,9 @@ void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra) const char *label; double size; alpm_list_t *requiredby = NULL; + alpm_pkgfrom_t from; - if(pkg == NULL) { - return; - } + from = alpm_pkg_get_origin(pkg); /* set variables here, do all output below */ bdate = alpm_pkg_get_builddate(pkg); diff --git a/src/pacman/package.h b/src/pacman/package.h index 6f71d20e..890b4fe1 100644 --- a/src/pacman/package.h +++ b/src/pacman/package.h @@ -22,14 +22,7 @@ #include <alpm.h> -/* TODO it would be nice if we didn't duplicate a backend type */ -enum pkg_from { - PKG_FROM_FILE = 1, - PKG_FROM_LOCALDB, - PKG_FROM_SYNCDB -}; - -void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra); +void dump_pkg_full(alpm_pkg_t *pkg, int extra); void dump_pkg_backups(alpm_pkg_t *pkg); void dump_pkg_files(alpm_pkg_t *pkg, int quiet); diff --git a/src/pacman/query.c b/src/pacman/query.c index ec98c999..5f2b37eb 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -460,9 +460,9 @@ static int display(alpm_pkg_t *pkg) if(config->op_q_info) { if(config->op_q_isfile) { - dump_pkg_full(pkg, PKG_FROM_FILE, 0); + dump_pkg_full(pkg, 0); } else { - dump_pkg_full(pkg, PKG_FROM_LOCALDB, config->op_q_info > 1); + dump_pkg_full(pkg, config->op_q_info > 1); } } if(config->op_q_list) { diff --git a/src/pacman/sync.c b/src/pacman/sync.c index a7fe5be9..e97da37a 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -469,7 +469,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) alpm_pkg_t *pkg = alpm_list_getdata(k); if(strcmp(alpm_pkg_get_name(pkg), pkgstr) == 0) { - dump_pkg_full(pkg, PKG_FROM_SYNCDB, config->op_s_info > 1); + dump_pkg_full(pkg, config->op_s_info > 1); foundpkg = 1; break; } @@ -494,7 +494,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) for(j = alpm_db_get_pkgcache(db); j; j = alpm_list_next(j)) { alpm_pkg_t *pkg = alpm_list_getdata(j); - dump_pkg_full(pkg, PKG_FROM_SYNCDB, config->op_s_info > 1); + dump_pkg_full(pkg, config->op_s_info > 1); } } } |