summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-08-28 23:41:17 -0500
committerDan McGee <dan@archlinux.org>2011-08-28 23:41:17 -0500
commit040083b97fab61c8afc16a1c49a8384d097c272a (patch)
tree97fb452adccf6f9f9d09356fdaae6115c878310b /src
parent3a458783a2617b7b22a756f95b5f66f3da79146f (diff)
downloadpacman-040083b97fab61c8afc16a1c49a8384d097c272a.tar.xz
Allow access to package origin data
Add new alpm_pkg_get_origin() method, use it in the front end now that the enum constants are publicly available. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/package.c7
-rw-r--r--src/pacman/package.h2
-rw-r--r--src/pacman/query.c4
-rw-r--r--src/pacman/sync.c4
4 files changed, 8 insertions, 9 deletions
diff --git a/src/pacman/package.c b/src/pacman/package.c
index f7065d54..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, alpm_pkgfrom_t 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, alpm_pkgfrom_t 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 4bbc2ba0..890b4fe1 100644
--- a/src/pacman/package.h
+++ b/src/pacman/package.h
@@ -22,7 +22,7 @@
#include <alpm.h>
-void dump_pkg_full(alpm_pkg_t *pkg, alpm_pkgfrom_t 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);
}
}
}