diff --git a/pisi/api.py b/pisi/api.py index 77ea7d1a..df6eb0b3 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -288,6 +288,10 @@ def configure_pending(): pisi.util.join_path(pkg_path, ctx.const.comar_dir), pisi.util.join_path(pkg_path, ctx.const.metadata_xml), pisi.util.join_path(pkg_path, ctx.const.files_xml), + None, + None, + m.package.version, + m.package.release ) ctx.ui.notify(pisi.ui.configured, package = pkginfo, files = None) ctx.installdb.clear_pending(x) diff --git a/pisi/atomicoperations.py b/pisi/atomicoperations.py index 441e6d6a..0d93265a 100644 --- a/pisi/atomicoperations.py +++ b/pisi/atomicoperations.py @@ -260,6 +260,13 @@ class Install(AtomicOperation): if ctx.comar: import pisi.comariface try: + if self.upgrade: + (iversion, irelease, ibuild) = ctx.installdb.get_version(self.pkginfo.name) + fromVersion = iversion + fromRelease = irelease + else: + fromVersion = None + fromRelease = None ctx.ui.notify(pisi.ui.configuring, package = self.pkginfo, files = self.files) pisi.comariface.post_install( self.pkginfo.name, @@ -267,6 +274,10 @@ class Install(AtomicOperation): 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), + fromVersion, + fromRelease, + self.metadata.package.version, + self.metadata.package.release ) ctx.ui.notify(pisi.ui.configured, package = self.pkginfo, files = self.files) except pisi.comariface.Error: diff --git a/pisi/comariface.py b/pisi/comariface.py index 1f53d2e8..09efd28a 100644 --- a/pisi/comariface.py +++ b/pisi/comariface.py @@ -93,7 +93,7 @@ def wait_for_result(com, package_name=None): elif cmd == com.DENIED: raise Error, _("comar denied our access") -def post_install(package_name, provided_scripts, scriptpath, metapath, filepath): +def post_install(package_name, provided_scripts, scriptpath, metapath, filepath, fromVersion, fromRelease, toVersion, toRelease): """Do package's post install operations""" ctx.ui.info(_("Configuring %s package") % package_name) @@ -112,8 +112,14 @@ def post_install(package_name, provided_scripts, scriptpath, metapath, filepath) wait_for_result(com) if self_post: + args = { + "fromVersion": fromVersion, + "fromRelease": fromRelease, + "toVersion": toVersion, + "toRelease": toRelease, + } ctx.ui.debug(_("Running package's post install script")) - com.call_package("System.Package.postInstall", package_name) + com.call_package("System.Package.postInstall", package_name, args) wait_for_result(com, package_name) def pre_remove(package_name, metapath, filepath):