summaryrefslogtreecommitdiffstats
path: root/src/pacman/remove.c
diff options
context:
space:
mode:
authorXavier Chantry <shiningxc@gmail.com>2009-07-15 19:14:01 +0200
committerDan McGee <dan@archlinux.org>2009-09-09 05:17:41 +0200
commit8ff3b87066d35d3518a3cd0bef27b86c3a85e983 (patch)
treea91691dccfa92d3021229f263b616ca4e35b5deb /src/pacman/remove.c
parent0da96abc900560f21c643b255c94a60232f4a24b (diff)
downloadpacman-8ff3b87066d35d3518a3cd0bef27b86c3a85e983.tar.gz
pacman-8ff3b87066d35d3518a3cd0bef27b86c3a85e983.tar.xz
Remove transaction type
This basically started with this change : /* Transaction */ struct __pmtrans_t { - pmtranstype_t type; pmtransflag_t flags; pmtransstate_t state; - alpm_list_t *packages; /* list of (pmpkg_t *) */ + alpm_list_t *add; /* list of (pmpkg_t *) */ + alpm_list_t *remove; /* list of (pmpkg_t *) */ And then I have to modify all the code accordingly.
Diffstat (limited to 'src/pacman/remove.c')
-rw-r--r--src/pacman/remove.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pacman/remove.c b/src/pacman/remove.c
index b5119fa5..258460c8 100644
--- a/src/pacman/remove.c
+++ b/src/pacman/remove.c
@@ -51,14 +51,14 @@ int pacman_remove(alpm_list_t *targets)
}
/* Step 0: create a new transaction */
- if(trans_init(PM_TRANS_TYPE_REMOVE, config->flags) == -1) {
+ if(trans_init(config->flags) == -1) {
return(1);
}
/* Step 1: add targets to the created transaction */
for(i = targets; i; i = alpm_list_next(i)) {
char *targ = alpm_list_getdata(i);
- if(alpm_trans_addtarget(targ) == -1) {
+ if(alpm_trans_remove(targ) == -1) {
if(pm_errno == PM_ERR_PKG_NOT_FOUND) {
printf(_("%s not found, searching for group...\n"), targ);
pmgrp_t *grp = alpm_db_readgrp(db_local, targ);
@@ -79,7 +79,7 @@ int pacman_remove(alpm_list_t *targets)
for(p = pkgnames; p; p = alpm_list_next(p)) {
char *pkgn = alpm_list_getdata(p);
if(all || yesno(_(":: Remove %s from group %s?"), pkgn, targ)) {
- if(alpm_trans_addtarget(pkgn) == -1) {
+ if(alpm_trans_remove(pkgn) == -1) {
pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", targ,
alpm_strerrorlast());
retval = 1;
@@ -129,7 +129,7 @@ int pacman_remove(alpm_list_t *targets)
/* Search for holdpkg in target list */
int holdpkg = 0;
- for(i = alpm_trans_get_pkgs(); i; i = alpm_list_next(i)) {
+ for(i = alpm_trans_get_remove(); i; i = alpm_list_next(i)) {
pmpkg_t *pkg = alpm_list_getdata(i);
if(alpm_list_find_str(config->holdpkg, alpm_pkg_get_name(pkg))) {
pm_printf(PM_LOG_WARNING, _("%s is designated as a HoldPkg.\n"),
@@ -146,7 +146,7 @@ int pacman_remove(alpm_list_t *targets)
if(config->flags & PM_TRANS_FLAG_RECURSE ||
config->flags & PM_TRANS_FLAG_CASCADE) {
/* list transaction targets */
- alpm_list_t *pkglist = alpm_trans_get_pkgs();
+ alpm_list_t *pkglist = alpm_trans_get_remove();
display_targets(pkglist, 0);
printf("\n");