summaryrefslogtreecommitdiff
path: root/src/pacman/remove.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-07-29 15:35:59 -0500
committerDan McGee <dan@archlinux.org>2011-09-28 04:52:37 -0500
commit7edeb276b63efeea7e8f266dfee792e2709ba412 (patch)
tree2f4b52b2c12b564b99825c99ec9ad874d8ed945a /src/pacman/remove.c
parentbd83c8e7562a2d6794d4322845c23cc21985979a (diff)
Keep track of explicitly added and removed packages
This allows us to sort the output list by showing all pulled dependencies first, followed by the explicitly specified targets. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/remove.c')
-rw-r--r--src/pacman/remove.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pacman/remove.c b/src/pacman/remove.c
index 95a728ee..3fc8279c 100644
--- a/src/pacman/remove.c
+++ b/src/pacman/remove.c
@@ -33,16 +33,17 @@
static int remove_target(const char *target)
{
- alpm_pkg_t *info;
+ alpm_pkg_t *pkg;
alpm_db_t *db_local = alpm_option_get_localdb(config->handle);
alpm_list_t *p;
- if((info = alpm_db_get_pkg(db_local, target)) != NULL) {
- if(alpm_remove_pkg(config->handle, info) == -1) {
+ if((pkg = alpm_db_get_pkg(db_local, target)) != NULL) {
+ if(alpm_remove_pkg(config->handle, pkg) == -1) {
pm_fprintf(stderr, ALPM_LOG_ERROR, "'%s': %s\n", target,
alpm_strerror(alpm_errno(config->handle)));
return -1;
}
+ config->explicit_removes = alpm_list_add(config->explicit_removes, pkg);
return 0;
}
@@ -53,12 +54,13 @@ static int remove_target(const char *target)
return -1;
}
for(p = grp->packages; p; p = alpm_list_next(p)) {
- alpm_pkg_t *pkg = alpm_list_getdata(p);
+ pkg = alpm_list_getdata(p);
if(alpm_remove_pkg(config->handle, pkg) == -1) {
pm_fprintf(stderr, ALPM_LOG_ERROR, "'%s': %s\n", target,
alpm_strerror(alpm_errno(config->handle)));
return -1;
}
+ config->explicit_removes = alpm_list_add(config->explicit_removes, pkg);
}
return 0;
}