From af90a0d65e013c59e0589d348d67ec26adb0cf66 Mon Sep 17 00:00:00 2001 From: Miroslav Grepl Date: Fri, 13 Jun 2014 08:21:26 +0200 Subject: [PATCH] Make selinux-policy build working also on another architectures related to sepolicy-manpage generate --- policycoreutils/sepolicy/sepolicy/__init__.py | 21 ++++++++++++--------- policycoreutils/sepolicy/sepolicy/manpage.py | 6 +++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/policycoreutils/sepolicy/sepolicy/__init__.py b/policycoreutils/sepolicy/sepolicy/__init__.py index 7ef8adf..e3943c0 100644 --- a/policycoreutils/sepolicy/sepolicy/__init__.py +++ b/policycoreutils/sepolicy/sepolicy/__init__.py @@ -888,16 +888,19 @@ def get_os_version(): output = subprocess.check_output("rpm -q '%s'" % pkg_name, stderr=subprocess.STDOUT, shell=True) - os_version = str(output).split(".")[-2] - except subprocess.CalledProcessError as e: - print(e.output) + try: + os_version = str(output).split(".")[-2] + if os_version[0:2] == "fc": + os_version = "Fedora"+os_version[2:] + elif os_version[0:2] == "el": + os_version = "RHEL"+os_version[2:] + else: + os_version = "Misc" + except IndexError: + os_version = "Misc" - if os_version[0:2] == "fc": - os_version = "Fedora"+os_version[2:] - elif os_version[0:2] == "el": - os_version = "RHEL"+os_version[2:] - else: - os_version = "" + except subprocess.CalledProcessError: + os_version = "Misc" return os_version diff --git a/policycoreutils/sepolicy/sepolicy/manpage.py b/policycoreutils/sepolicy/sepolicy/manpage.py index 1765b1c..ecb4461 100755 --- a/policycoreutils/sepolicy/sepolicy/manpage.py +++ b/policycoreutils/sepolicy/sepolicy/manpage.py @@ -175,7 +175,7 @@ class HTMLManPages: self.old_path = path + "/" self.new_path = self.old_path + self.os_version+"/" - if self.os_version in fedora_releases or rhel_releases: + if (self.os_version in fedora_releases) or (self.os_version in rhel_releases) or (self.os_version == "Misc"): self.__gen_html_manpages() else: print(("SELinux HTML man pages can not be generated for this %s" % os_version)) @@ -255,10 +255,10 @@ Fedora or Red Hat Enterprise Linux Man Pages. - Linux man-pages online for Fedora18 + Linux man-pages online for Fedora/RHEL -

SELinux man pages for Fedora18

+

SELinux man pages for Fedora/RHEL


-- 2.0.0