Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/add.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 5fda291c..84bf4c3a 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -511,21 +511,20 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
if(!stat(expath, &buf) && !S_ISDIR(buf.st_mode)) {
/* file already exists */
- if(_alpm_list_is_strin(pathname, handle->noupgrade)) {
- notouch = 1;
- nb = 1;
+ if(!pmo_upgrade || oldpkg == NULL) {
+ nb = _alpm_list_is_strin(pathname, info->backup);
} else {
- if(!pmo_upgrade || oldpkg == NULL) {
- nb = _alpm_list_is_strin(pathname, info->backup);
- } else {
- /* op == PM_TRANS_TYPE_UPGRADE */
- md5_orig = _alpm_needbackup(pathname, oldpkg->backup);
- sha1_orig = _alpm_needbackup(pathname, oldpkg->backup);
- if(md5_orig || sha1_orig) {
- nb = 1;
- }
+ /* op == PM_TRANS_TYPE_UPGRADE */
+ md5_orig = _alpm_needbackup(pathname, oldpkg->backup);
+ sha1_orig = _alpm_needbackup(pathname, oldpkg->backup);
+ if(md5_orig || sha1_orig) {
+ nb = 1;
}
}
+ if(_alpm_list_is_strin(pathname, handle->noupgrade)) {
+ notouch = 1;
+ nb = 0;
+ }
}
if(nb) {
@@ -623,7 +622,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
alpm_logaction(_("warning: %s saved as %s"), expath, newpath);
}
}
- } else if(md5_pkg || sha1_pkg) {
+ } else if(md5_orig || sha1_pkg) {
/* PM_UPGRADE */
int installnew = 0;