{from,to}{Version,Release} arguments for postInstall method.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
+8
-2
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user