def updateConfig(self, dv): if not os.path.exists("/etc/calculate/calculate.env") and not ( dv.Get("cl_core_pkg_name") in ("calculate-utilities", "calculate-install") and getTupleVersion(dv.Get("cl_core_pkg_version")) >= getTupleVersion("3.1.0_alpha4") ): self.printWARNING(_("Configuration skipping until calculate-utilities are updated")) return True self.initVars(dv) clVars = DataVars() clVars.importData() clVars.flIniFile() slot = dv.Get("cl_core_pkg_slot") version = dv.Get("cl_core_pkg_version") category = dv.Get("cl_core_pkg_category") nameProgram = dv.Get("cl_core_pkg_name") # define that category/nameProgram installed if dv.Get("cl_ebuild_phase") in ("prerm", "postrm"): version = "" dictVer = {slot: version} cl_template.templateFunction.installProg.update( {"%s/%s" % (category, nameProgram): dictVer, "%s" % (nameProgram): dictVer} ) try: if os.environ.get("EBUILD_PHASE", ""): clVars.raiseVariableNotFound = lambda name, *args, **kwargs: StubVariable(*args, **kwargs) clVars.raiseModuleError = lambda name, *args, **kwargs: False if dv.Get("cl_core_pkg_system_set") == "on": self.updateSystemConfig(dv, clVars) if dv.Get("cl_core_pkg_desktop_set") == "on" and not dv.Get("cl_ebuild_phase") in ("preinst", "prerm"): self.updateDesktopConfig(dv, clVars) finally: if clVars: clVars.close() return True