diff options
Diffstat (limited to 'src/pacman/upgrade.c')
-rw-r--r-- | src/pacman/upgrade.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c index 1442eb56..8cd29da0 100644 --- a/src/pacman/upgrade.c +++ b/src/pacman/upgrade.c @@ -1,7 +1,7 @@ /* * upgrade.c * - * Copyright (c) 2006-2010 Pacman Development Team <pacman-dev@archlinux.org> + * Copyright (c) 2006-2011 Pacman Development Team <pacman-dev@archlinux.org> * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org> * * This program is free software; you can redistribute it and/or modify @@ -55,6 +55,8 @@ int pacman_upgrade(alpm_list_t *targets) if(strstr(i->data, "://")) { char *str = alpm_fetch_pkgurl(i->data); if(str == NULL) { + pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", + (char *)i->data, alpm_strerrorlast()); return(1); } else { free(i->data); @@ -71,9 +73,18 @@ int pacman_upgrade(alpm_list_t *targets) /* add targets to the created transaction */ for(i = targets; i; i = alpm_list_next(i)) { char *targ = alpm_list_getdata(i); - if(alpm_add_target(targ) == -1) { + pmpkg_t *pkg; + + if(alpm_pkg_load(targ, 1, &pkg) != 0) { + pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", + targ, alpm_strerrorlast()); + trans_release(); + return(1); + } + if(alpm_add_pkg(pkg) == -1) { pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", targ, alpm_strerrorlast()); + alpm_pkg_free(pkg); trans_release(); return(1); } @@ -112,7 +123,7 @@ int pacman_upgrade(alpm_list_t *targets) const char *package2 = alpm_conflict_get_package2(conflict); const char *reason = alpm_conflict_get_reason(conflict); /* only print reason if it contains new information */ - if(!strcmp(package1, reason) || !strcmp(package2, reason)) { + if(strcmp(package1, reason) == 0 || strcmp(package2, reason) == 0) { printf(_(":: %s and %s are in conflict\n"), package1, package2); } else { printf(_(":: %s and %s are in conflict (%s)\n"), package1, package2, reason); |