diff options
author | Dan McGee <dan@archlinux.org> | 2011-06-16 11:55:26 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-06-16 11:58:04 -0500 |
commit | 25b7df4dab61e908a0f86e3aad51f1f5c9ed2ccb (patch) | |
tree | 805ef5081dbd23ac4de7ca154d89c25d2068efe3 /src | |
parent | 51359e6d33cf2f3f3acf95ad526c5b22e39d86cf (diff) | |
download | pacman-25b7df4dab61e908a0f86e3aad51f1f5c9ed2ccb.tar.xz |
Make pmgrp_t public
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/pacman/query.c | 15 | ||||
-rw-r--r-- | src/pacman/remove.c | 2 | ||||
-rw-r--r-- | src/pacman/sync.c | 9 |
3 files changed, 11 insertions, 15 deletions
diff --git a/src/pacman/query.c b/src/pacman/query.c index 06fd704a..aa779075 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -304,14 +304,11 @@ static int query_group(alpm_list_t *targets) if(targets == NULL) { for(j = alpm_db_get_grpcache(db_local); j; j = alpm_list_next(j)) { pmgrp_t *grp = alpm_list_getdata(j); - const alpm_list_t *p, *packages; - const char *grpname; + const alpm_list_t *p; - grpname = alpm_grp_get_name(grp); - packages = alpm_grp_get_pkgs(grp); - - for(p = packages; p; p = alpm_list_next(p)) { - printf("%s %s\n", grpname, alpm_pkg_get_name(alpm_list_getdata(p))); + for(p = grp->packages; p; p = alpm_list_next(p)) { + pmpkg_t *pkg = alpm_list_getdata(p); + printf("%s %s\n", grp->name, alpm_pkg_get_name(pkg)); } } } else { @@ -320,8 +317,8 @@ static int query_group(alpm_list_t *targets) grpname = alpm_list_getdata(i); grp = alpm_db_readgrp(db_local, grpname); if(grp) { - const alpm_list_t *p, *packages = alpm_grp_get_pkgs(grp); - for(p = packages; p; p = alpm_list_next(p)) { + const alpm_list_t *p; + for(p = grp->packages; p; p = alpm_list_next(p)) { if(!config->quiet) { printf("%s %s\n", grpname, alpm_pkg_get_name(alpm_list_getdata(p))); diff --git a/src/pacman/remove.c b/src/pacman/remove.c index 2ce33b8a..60027ae2 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -52,7 +52,7 @@ static int remove_target(const char *target) pm_fprintf(stderr, PM_LOG_ERROR, "'%s': target not found\n", target); return -1; } - for(p = alpm_grp_get_pkgs(grp); p; p = alpm_list_next(p)) { + for(p = grp->packages; p; p = alpm_list_next(p)) { pmpkg_t *pkg = alpm_list_getdata(p); if(alpm_remove_pkg(config->handle, pkg) == -1) { pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", target, diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 177eab64..acb8a333 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -409,7 +409,7 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets) if(grp) { /* get names of packages in group */ - for(k = alpm_grp_get_pkgs(grp); k; k = alpm_list_next(k)) { + for(k = grp->packages; k; k = alpm_list_next(k)) { if(!config->quiet) { printf("%s %s\n", grpname, alpm_pkg_get_name(alpm_list_getdata(k))); @@ -426,16 +426,15 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets) for(j = alpm_db_get_grpcache(db); j; j = alpm_list_next(j)) { pmgrp_t *grp = alpm_list_getdata(j); - const char *grpname = alpm_grp_get_name(grp); if(level > 1) { - for(k = alpm_grp_get_pkgs(grp); k; k = alpm_list_next(k)) { - printf("%s %s\n", grpname, + for(k = grp->packages; k; k = alpm_list_next(k)) { + printf("%s %s\n", grp->name, alpm_pkg_get_name(alpm_list_getdata(k))); } } else { /* print grp names only, no package names */ - printf("%s\n", grpname); + printf("%s\n", grp->name); } } } |