From 796490546e2d3868a387ff18b05f2fa382a9aa7e Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 22 Dec 2006 06:07:33 +0000 Subject: * Properly fix the NoUpgrade issues. --- TODO.aaron | 13 +++++++++---- lib/libalpm/add.c | 25 ++++++++++++------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/TODO.aaron b/TODO.aaron index dee8ddff..823289d6 100644 --- a/TODO.aaron +++ b/TODO.aaron @@ -1,17 +1,22 @@ == This is my custom TODO file == +* pacman: ALOT of functions are way too long. There should be an upper limit of + 100-200 lines. _alpm_add_commit is around 600 lines, and is far too complex. + Quite alot of this needs to be refactored as we go. + +* pacman: fixup doxygen documentation for public interface + +* pacman: use gcc visibility (static) for non-public functions (all _alpm + functions should be static) + **** BUGS **** * Removal of conflicts on -A and -U (INCOMPLETE) - * gensync: get all info from packages instead of PKGBUILDs for now, we only need to check the PKGBUILD in case of a 'force' option -* gensync and makepkg: support for 1 _or more_ file integrity - algorithms at a time (mostly done). * pacman: add pactest cases/functionality for all -Q operations and make sure the output is sane -* etc/pacman.d/ install rules * ordering of installed packages based on dependencies i.e. pkga depends=(pkgb pkgc), pkgb depends=(pkgc) pacman -S pkga pkgb pkgc 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; -- cgit v1.2.3-24-g4f1b