def pre_install(self): super().pre_install() # Set rpm-specific options # nofsync speeds things up at the risk of rpmdb data loss in a crash. # But if we crash mid-install you're boned anyway, so who cares? self.rpm_macros.append(('__dbi_htconfig', 'hash nofsync %{__dbi_other} %{__dbi_perms}')) if self.data.packages.excludeDocs: self.rpm_macros.append(('_excludedocs', '1')) if self.data.packages.instLangs is not None: # Use nil if instLangs is empty self.rpm_macros.append(('_install_langs', self.data.packages.instLangs or '%{nil}')) if conf.security.selinux: for d in ["/tmp/updates", "/etc/selinux/targeted/contexts/files", "/etc/security/selinux/src/policy", "/etc/security/selinux"]: f = d + "/file_contexts" if os.access(f, os.R_OK): self.rpm_macros.append(('__file_context_path', f)) break else: self.rpm_macros.append(('__file_context_path', '%{nil}')) # Add platform specific group groupid = util.get_platform_groupid() if groupid and groupid in self.groups: self.requirements.add_groups([groupid], reason="platform") elif groupid: log.warning("Platform group %s not available.", groupid)
def pre_install(self): super().pre_install() # Set rpm-specific options # nofsync speeds things up at the risk of rpmdb data loss in a crash. # But if we crash mid-install you're boned anyway, so who cares? self.rpm_macros.append(('__dbi_htconfig', 'hash nofsync %{__dbi_other} %{__dbi_perms}')) if self.data.packages.excludeDocs: self.rpm_macros.append(('_excludedocs', '1')) if self.data.packages.instLangs is not None: # Use nil if instLangs is empty self.rpm_macros.append(('_install_langs', self.data.packages.instLangs or '%{nil}')) if conf.security.selinux: for d in ["/tmp/updates", "/etc/selinux/targeted/contexts/files", "/etc/security/selinux/src/policy", "/etc/security/selinux"]: f = d + "/file_contexts" if os.access(f, os.R_OK): self.rpm_macros.append(('__file_context_path', f)) break else: self.rpm_macros.append(('__file_context_path', '%{nil}')) # Add platform specific group groupid = util.get_platform_groupid() if groupid and groupid in self.groups: self.requirements.add_groups([groupid], reason="platform") elif groupid: log.warning("Platform group %s not available.", groupid)