* 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 <package>" session, an advanced user may even update 
  the script and "pisi cp" it again. So marking it as cp is not a bad 
  idea.

* 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ı
This commit is contained in:
Faik Uygur
2006-11-03 18:12:47 +00:00
parent c41f8cf05c
commit 13749ce912
2 changed files with 15 additions and 9 deletions
+4
View File
@@ -240,6 +240,7 @@ class Install(AtomicOperation):
self.config_later = False self.config_later = False
if ctx.comar: if ctx.comar:
import pisi.comariface import pisi.comariface
try:
ctx.ui.notify(pisi.ui.configuring, package = self.pkginfo, files = self.files) ctx.ui.notify(pisi.ui.configuring, package = self.pkginfo, files = self.files)
pisi.comariface.post_install( pisi.comariface.post_install(
self.pkginfo.name, self.pkginfo.name,
@@ -249,6 +250,9 @@ class Install(AtomicOperation):
os.path.join(self.package.pkg_dir(), ctx.const.files_xml), os.path.join(self.package.pkg_dir(), ctx.const.files_xml),
) )
ctx.ui.notify(pisi.ui.configured, package = self.pkginfo, files = self.files) 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: else:
self.config_later = True self.config_later = True
+2
View File
@@ -189,6 +189,8 @@ class InstallDB:
info = self.d.get(pkg, txn) info = self.d.get(pkg, txn)
info.state = 'r' info.state = 'r'
self.d.put(pkg, info, txn) self.d.put(pkg, info, txn)
if self.dp.has_key(pkg):
self.dp.delete(pkg, txn)
self.d.txn_proc(proc, txn) self.d.txn_proc(proc, txn)
def purge(self, pkg, txn = None): def purge(self, pkg, txn = None):