[pacman-dev] UPGRADERM patch
About Nagy patch and comment here : http://www.archlinux.org/pipermail/pacman-dev/2007-April/008054.html http://www.archlinux.org/pipermail/pacman-dev/2007-April/008132.html I think adding a special UPGRADERM type for this pseudo remove transaction is better than the previous fix which just added this check for eliminating duplicated required by : if(!alpm_list_find_str(rqdby, pkgname)) { But this just makes the existence of this pseudo remove transaction more explicit. And as seen in add.c code, this should be fixed : 362 /* this is kinda odd. If the old package exists, at this point we make a 363 * NEW transaction, unrelated to handle->trans, and instantiate a "remove" 364 * with the type PM_TRANS_TYPE_UPGRADE. TODO: kill this weird behavior. */ I asked Dan about it on irc : 15:44 shining >> if there is a way to kill this weird behavior totally, then maybe there should be a bit more details about how to do, so we can reject Nagy patch ? 16:11 toofishes >> well i sure don't know it yet 16:12 toofishes >> i'm saying this- i hate the way alpm tries to have these "transactions" that aren't transactional in nature at all (meaning fully finish or never start) 16:12 toofishes >> alpm_trans_start() 16:12 toofishes >> alpm_install(pkg) 16:12 toofishes >> alpm_remove(pkg) 16:13 toofishes >> alpm_trans_end() (which checks to make sure transaction is possible) 16:13 toofishes >> alpm_trans_commit() (which carries out the install) So it looks like there is a lot of work to be done here, for fixing the problem correctly.
Hi!
I think adding a special UPGRADERM type for this pseudo remove transaction is better than the previous fix which just added this check for eliminating duplicated required by : if(!alpm_list_find_str(rqdby, pkgname)) { And don't forget that pacman can still corrupt the database, because now it simply wants to add the requiredby entry instead of removing it. To show this I provide a testfile: ====requiredby004.py==== self.description = "Upgrade a package that no longer need a depend"
lp1 = pmpkg("pkg1", "1.1-1") lp1.depends = ["pkg2"] self.addpkg2db("local", lp1) lp2 = pmpkg("pkg2") lp2.requiredby = ["pkg1"] self.addpkg2db("local", lp2) p = pmpkg("pkg1", "1.2-1") self.addpkg(p) self.args = "-U %s" % p.filename() self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=pkg1") self.addrule("PKG_VERSION=pkg1|1.2-1") self.addrule("PKG_EXIST=pkg2") self.addrule("!PKG_REQUIREDBY=pkg2|pkg1")
Thanks for the pactest, applied it in my tree : http://chantry.homelinux.org/~xav/git/gitweb.cgi?p=pacman.git;a=commit;h=792...
participants (2)
-
Nagy Gabor
-
Xavier