From 13749ce9127552e1ed6e2eb77abe0fb001b7d1a1 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Fri, 3 Nov 2006 18:12:47 +0000 Subject: [PATCH] * if post-install fails do not fail pisi, just print a warning and mark package as configure-pending. This will help for two reasons. First the user will find out the failed configurations. And second, failing "pisi cp " session, an advanced user may even update the script and "pisi cp" it again. So marking it as cp is not a bad idea. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix for a scenario that came to mind and resulted as expected. faik@iago traceroute $ pisi lp traceroute faik@iago traceroute $ sudo pisi rm traceroute Bağımlılıkları sağlamak için bu paketler verilen sırada kaldırılacaktır: traceroute traceroute paketi kaldırılıyor Paket kaldırılmak üzere yapılandırılıyor traceroute paketi kaldırıldı faik@iago traceroute $ pisi lp traceroute faik@iago traceroute $ sudo pisi cp Program sonlandırıldı. Paket traceroute bulunamadı --- pisi/atomicoperations.py | 22 +++++++++++++--------- pisi/installdb.py | 2 ++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/pisi/atomicoperations.py b/pisi/atomicoperations.py index 1745d6b7..cf54e3c6 100644 --- a/pisi/atomicoperations.py +++ b/pisi/atomicoperations.py @@ -240,15 +240,19 @@ class Install(AtomicOperation): self.config_later = False if ctx.comar: import pisi.comariface - ctx.ui.notify(pisi.ui.configuring, package = self.pkginfo, files = self.files) - pisi.comariface.post_install( - self.pkginfo.name, - self.metadata.package.providesComar, - self.package.comar_dir(), - os.path.join(self.package.pkg_dir(), ctx.const.metadata_xml), - os.path.join(self.package.pkg_dir(), ctx.const.files_xml), - ) - ctx.ui.notify(pisi.ui.configured, package = self.pkginfo, files = self.files) + try: + ctx.ui.notify(pisi.ui.configuring, package = self.pkginfo, files = self.files) + pisi.comariface.post_install( + self.pkginfo.name, + self.metadata.package.providesComar, + self.package.comar_dir(), + os.path.join(self.package.pkg_dir(), ctx.const.metadata_xml), + os.path.join(self.package.pkg_dir(), ctx.const.files_xml), + ) + ctx.ui.notify(pisi.ui.configured, package = self.pkginfo, files = self.files) + except pisi.comariface.Error: + ctx.ui.warning(_('%s configuration failed.') % self.pkginfo.name) + self.config_later = True else: self.config_later = True diff --git a/pisi/installdb.py b/pisi/installdb.py index 369cdca2..9e36be74 100644 --- a/pisi/installdb.py +++ b/pisi/installdb.py @@ -189,6 +189,8 @@ class InstallDB: info = self.d.get(pkg, txn) info.state = 'r' self.d.put(pkg, info, txn) + if self.dp.has_key(pkg): + self.dp.delete(pkg, txn) self.d.txn_proc(proc, txn) def purge(self, pkg, txn = None):