[anaconda][rhel7-branch][PATCH] Add support for architecture suffixes in help files (#1072033)
Martin Kolman
mkolman at redhat.com
Thu Jan 15 19:24:22 UTC 2015
For some Anaconda screens there might be multiple help file variants,
differentiated by an architecture specific suffix. Other screens that
are not influenced by architectural differences have a single version,
which uses the "common" prefix.
These two don't mix - the given screen is either covered by a single common file
or by a set of files with architecture specific suffixes for all supported
architectures.
Related: rhbz#1072033
Signed-off-by: Martin Kolman <mkolman at redhat.com>
---
pyanaconda/ihelp.py | 42 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ihelp.py b/pyanaconda/ihelp.py
index 3e7446a..6c9b79a 100644
--- a/pyanaconda/ihelp.py
+++ b/pyanaconda/ihelp.py
@@ -27,9 +27,13 @@ from pyanaconda.flags import flags
from pyanaconda.localization import find_best_locale_match
from pyanaconda.constants import DEFAULT_LANG
+import blivet
+
import logging
log = logging.getLogger("anaconda")
+COMMON_HELP_FILE_VARIANT_SUFFIX = "common"
+
yelp_process = None
def _get_best_help_file(help_folder, help_file):
@@ -93,8 +97,44 @@ def get_help_path(help_file, instclass):
# help l10n handling
if help_file:
+ # Some of the RHEL7 installation guide pages might be marked as "common",
+ # meaning that their content is common for all architectures, while
+ # other pages might be architecture specific. These two categories
+ # are mutually exclusive - if there is a common variant, there will be
+ # no arch specific variant and if there are arch specific variants,
+ # there will be no common variant.
+
+ #help_path = _get_best_help_file(instclass.help_folder, help_file)
+
+ # check for the common variant
+ file_head, file_tail = os.path.splitext(help_file)
+
+ help_file = "%s-%s%s" % (file_head, COMMON_HELP_FILE_VARIANT_SUFFIX, file_tail)
+ help_path = _get_best_help_file(instclass.help_folder, help_file)
+ if help_path:
+ log.debug("found a common help file variant at %s", help_path)
+ return help_path
+
+ # check for the arch specific variant
+
+ # the documentation files don't differentiate between 32bit and 64bit x86
+ # and just use a "x86" suffix for both
+ if blivet.arch.isX86:
+ arch = "x86"
+ # same thing for s390 (31 bit) and s390x (64 bit), they are just "s390"
+ elif blivet.arch.isS390():
+ arch = "s390"
+ # 32 bit PPC is no longer supported in RHEL and both 64 bit PPC variants (BE and LE)
+ # are covered with the "ppc64" suffix
+ elif blivet.arch.isPPC():
+ arch = "ppc64"
+ else:
+ arch = blivet.arch.getArch()
+
+ help_file = "%s-%s%s" % (file_head, arch, file_tail)
help_path = _get_best_help_file(instclass.help_folder, help_file)
- if help_path is not None:
+ if help_path:
+ log.debug("found arch specific help file variant at %s", help_path)
return help_path
# the screen did not have a helpFile defined or the defined help file
--
2.1.0
More information about the anaconda-patches
mailing list