This issue happend if %prepackages %packages sections are both in ks files.
Refering the change in https://github.com/rpm-software-management/rpm/commit/
51b306686c46dfa67f6f9d16f0190c99f55339dd
Initialize plugins much earlier, it is initialized in AddInstall funciton not run(),
Before in rpm 4.11, once ts_pre run(), it will re-initialize plugins.
But now for rpm 4.14, after ts_pre.run() finish, msm handler is freed, so in ts.run(), when checking msm
handler, because it is NULL, this error will come.
So should call ts.AddInstall() after ts_pre.run().
error: Device security policy is missing. Unable to proceed
error: Plugin msm: hook tsm_pre failed
Change-Id: Iddd7c3c1c942960724c554926c444720d067f0bb
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
self.Z = None
self.ts = None
self.ts_pre = None
+ self.pkgs_bak = []
self.incpkgs = {}
self.excpkgs = {}
self.pre_pkgs = []
if self.ts_pre:
self.ts_pre.closeDB()
- self.ts = None
+ self.ts_pre = None
+
+ self.pkgs_bak = []
self.closeRpmDB()
msger.verbose("pre-install package added: %s" % pkgname)
self.ts_pre.addInstall(h, rpmpath, 'u')
- self.ts.addInstall(h, rpmpath, 'u')
+ #for rpm4.14 vesion, need to split addInstall for these two transactionSet.
+ #addInstall for self.ts should be after self.ts_pre done.
+ self.pkgs_bak.append({"header": h, "rpmpath": rpmpath})
unresolved_dependencies = self.ts.check()
if not unresolved_dependencies:
if self.pre_pkgs:
self.preinstallPkgs()
+ for pkg_bak in self.pkgs_bak:
+ self.ts.addInstall(pkg_bak["header"], pkg_bak["rpmpath"], 'u')
self.ts.order()
cb = rpmmisc.RPMInstallCallback(self.ts)
installlogfile = "%s/__catched_stderr.buf" % (self.instroot)
msger.disable_logstderr()
self.ts.closeDB()
self.ts = None
+ self.pkgs_bak = []
if errors is not None:
if len(errors) == 0: