summaryrefslogtreecommitdiff
path: root/src/pacman/upgrade.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pacman/upgrade.c')
-rw-r--r--src/pacman/upgrade.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c
index 8cd29da0..0ffc94c4 100644
--- a/src/pacman/upgrade.c
+++ b/src/pacman/upgrade.c
@@ -42,11 +42,12 @@
int pacman_upgrade(alpm_list_t *targets)
{
alpm_list_t *i, *data = NULL;
+ pgp_verify_t check_sig = alpm_option_get_default_sigverify();
int retval = 0;
if(targets == NULL) {
pm_printf(PM_LOG_ERROR, _("no targets specified (use -h for help)\n"));
- return(1);
+ return 1;
}
/* Check for URL targets and process them
@@ -57,7 +58,7 @@ int pacman_upgrade(alpm_list_t *targets)
if(str == NULL) {
pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n",
(char *)i->data, alpm_strerrorlast());
- return(1);
+ return 1;
} else {
free(i->data);
i->data = str;
@@ -67,7 +68,7 @@ int pacman_upgrade(alpm_list_t *targets)
/* Step 1: create a new transaction */
if(trans_init(config->flags) == -1) {
- return(1);
+ return 1;
}
/* add targets to the created transaction */
@@ -75,18 +76,18 @@ int pacman_upgrade(alpm_list_t *targets)
char *targ = alpm_list_getdata(i);
pmpkg_t *pkg;
- if(alpm_pkg_load(targ, 1, &pkg) != 0) {
+ if(alpm_pkg_load(targ, 1, check_sig, &pkg) != 0) {
pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n",
targ, alpm_strerrorlast());
trans_release();
- return(1);
+ 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);
+ return 1;
}
}
@@ -135,7 +136,7 @@ int pacman_upgrade(alpm_list_t *targets)
}
trans_release();
FREELIST(data);
- return(1);
+ return 1;
}
/* Step 3: perform the installation */
@@ -143,7 +144,7 @@ int pacman_upgrade(alpm_list_t *targets)
if(config->print) {
print_packages(alpm_trans_get_add());
trans_release();
- return(0);
+ return 0;
}
/* print targets and ask user confirmation */
@@ -151,7 +152,7 @@ int pacman_upgrade(alpm_list_t *targets)
if(packages == NULL) { /* we are done */
printf(_(" there is nothing to do\n"));
trans_release();
- return(retval);
+ return retval;
}
display_targets(alpm_trans_get_remove(), 0);
display_targets(alpm_trans_get_add(), 1);
@@ -159,7 +160,7 @@ int pacman_upgrade(alpm_list_t *targets)
int confirm = yesno(_("Proceed with installation?"));
if(!confirm) {
trans_release();
- return(retval);
+ return retval;
}
if(alpm_trans_commit(&data) == -1) {
@@ -197,13 +198,13 @@ int pacman_upgrade(alpm_list_t *targets)
}
FREELIST(data);
trans_release();
- return(1);
+ return 1;
}
if(trans_release() == -1) {
retval = 1;
}
- return(retval);
+ return retval;
}
/* vim: set ts=2 sw=2 noet: */