[pacman-dev] Some small issues with backup relocation: upgrade044.py; needless .pacorig
Look at the following pactest file: ---upgrade044.py--- self.description = "Backup file relocation (package split)" lp = pmpkg("foo") lp.files = ["etc/foo.cfg*"] lp.backup = ["etc/foo.cfg"] self.addpkg2db("local", lp) p1 = pmpkg("foo", "1.0-2") self.addpkg(p1) p2 = pmpkg("libfoo", "1.0-2") p2.files = ["etc/foo.cfg**"] p2.backup = ["etc/foo.cfg"] self.addpkg(p2) self.filesystem = ["etc/foo.cfg"] self.args = "-U %s" % " ".join([p.filename() for p in p1, p2]) self.addrule("PKG_VERSION=foo|1.0-2") self.addrule("PKG_VERSION=libfoo|1.0-2") self.addrule("!FILE_PACSAVE=etc/foo.cfg") self.addrule("FILE_PACNEW=etc/foo.cfg") self.addrule("FILE_EXIST=etc/foo.cfg") ---------- This pactest fails, which means that we get different behaviour, if we had libfoo installed (see upgrade042.py and upgrade043.py). The difference is the immediate corollary of line 501 in add.c (libalpm). It's important to see, that if --force wasn't set we reach that line iff the file was backed up by the transaction, so .pacorig has no meaning in this case. So this .pacorig stuff has meaning with --force, but as I see backup handling with --force is not well defined :-P Bye, ngaba PS: and this .pacorig extension is quite misleading, it suggests "original config file" to me; using .pacsave is more suggestive here imho. ---------------------------------------------------- SZTE Egyetemi Könyvtár - http://www.bibl.u-szeged.hu This mail sent through IMP: http://horde.org/imp/
---upgrade044.py--- self.description = "Backup file relocation (package split)"
lp = pmpkg("foo") lp.files = ["etc/foo.cfg*"] lp.backup = ["etc/foo.cfg"] self.addpkg2db("local", lp)
p1 = pmpkg("foo", "1.0-2") self.addpkg(p1)
p2 = pmpkg("libfoo", "1.0-2") p2.files = ["etc/foo.cfg**"] p2.backup = ["etc/foo.cfg"] self.addpkg(p2)
self.filesystem = ["etc/foo.cfg"]
self.args = "-U %s" % " ".join([p.filename() for p in p1, p2])
self.addrule("PKG_VERSION=foo|1.0-2") self.addrule("PKG_VERSION=libfoo|1.0-2") self.addrule("!FILE_PACSAVE=etc/foo.cfg") self.addrule("FILE_PACNEW=etc/foo.cfg") self.addrule("FILE_EXIST=etc/foo.cfg") ----------
A bit more problematic issue: If you remove the p2.backup line, etc/foo.cfg will be simply overwritten! So if a file changes owner and leaves backup, the old backup field has no effect. This is still an edge case, but this shouldn't happen. Bye ---------------------------------------------------- SZTE Egyetemi Könyvtár - http://www.bibl.u-szeged.hu This mail sent through IMP: http://horde.org/imp/
participants (1)
-
Nagy Gabor