1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

display the list of targets to be removed before trans_commit() call

This commit is contained in:
Aurelien Foret 2005-04-20 20:49:39 +00:00
parent 406f383192
commit 2a3968b8bc

View File

@ -516,15 +516,21 @@ int pacman_sync(list_t *targets)
unsigned long totalsize = 0; unsigned long totalsize = 0;
double mb; double mb;
/* ORE packages = alpm_trans_getinfo(PM_TRANS_PACKAGES);
for(i = rmtargs; i; i = i->next) { if(packages == NULL) {
list = list_add(list, strdup(i->data)); retval = 0;
goto cleanup;
} }
for(i = final; i; i = i->next) {
syncpkg_t *s = (syncpkg_t*)i->data; for(lp = alpm_list_first(packages); lp; lp = alpm_list_next(lp)) {
for(j = s->replaces; j; j = j->next) { PM_SYNCPKG *sync = alpm_list_getdata(lp);
pkginfo_t *p = (pkginfo_t*)j->data; if((int)alpm_sync_getinfo(sync, PM_SYNC_TYPE) == PM_SYNC_TYPE_REPLACE) {
list = list_add(list, strdup(p->name)); PM_LIST *j, *data;
data = alpm_sync_getinfo(sync, PM_SYNC_DATA);
for(j = alpm_list_first(data); j; j = alpm_list_next(j)) {
PM_PKG *p = alpm_list_getdata(j);
list = list_add(list, strdup((char *)alpm_pkg_getinfo(p, PM_PKG_NAME)));
}
} }
} }
if(list) { if(list) {
@ -534,11 +540,6 @@ int pacman_sync(list_t *targets)
printf("\n"); printf("\n");
FREELIST(list); FREELIST(list);
FREE(str); FREE(str);
}*/
packages = alpm_trans_getinfo(PM_TRANS_PACKAGES);
if(packages == NULL) {
retval = 0;
goto cleanup;
} }
for(lp = alpm_list_first(packages); lp; lp = alpm_list_next(lp)) { for(lp = alpm_list_first(packages); lp; lp = alpm_list_next(lp)) {
char *pkgname, *pkgver; char *pkgname, *pkgver;
@ -548,8 +549,7 @@ int pacman_sync(list_t *targets)
pkgname = alpm_pkg_getinfo(pkg, PM_PKG_NAME); pkgname = alpm_pkg_getinfo(pkg, PM_PKG_NAME);
pkgver = alpm_pkg_getinfo(pkg, PM_PKG_VERSION); pkgver = alpm_pkg_getinfo(pkg, PM_PKG_VERSION);
MALLOC(str, strlen(pkgname)+strlen(pkgver)+2); asprintf(&str, "%s-%s", pkgname, pkgver);
sprintf(str, "%s-%s", pkgname, pkgver);
list = list_add(list, str); list = list_add(list, str);
totalsize += (int)alpm_pkg_getinfo(pkg, PM_PKG_SIZE); totalsize += (int)alpm_pkg_getinfo(pkg, PM_PKG_SIZE);