From dcb42a417355510284a35c08a4bf849047122a5c Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 13 Oct 2011 23:14:40 -0700 Subject: [PATCH] Add QA_SONAME_NO_SYMLINK for bug #387053. --- bin/misc-functions.sh | 4 ++++ man/ebuild.5 | 6 ++++++ pym/portage/package/ebuild/doebuild.py | 28 ++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 882d17165..b3e62c5fe 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -372,6 +372,10 @@ install_qa_check() { fi done } + [ -n "${QA_SONAME_NO_SYMLINK}" ] && \ + echo "${QA_SONAME_NO_SYMLINK}" > \ + "${PORTAGE_BUILDDIR}"/build-info/QA_SONAME_NO_SYMLINK + if [[ ${insecure_rpath} -eq 1 ]] ; then die "Aborting due to serious QA concerns with RUNPATH/RPATH" elif [[ -n ${die_msg} ]] && has stricter ${FEATURES} ; then diff --git a/man/ebuild.5 b/man/ebuild.5 index 0ad5da1ac..2d58c9e61 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -620,6 +620,12 @@ This should contain a list of file paths, relative to the image directory, of shared libraries that lack SONAMEs. The paths may contain regular expressions with escape\-quoted special characters. .TP +\fBQA_SONAME_NO_SYMLINK\fR +This should contain a list of file paths, relative to the image directory, of +shared libraries that have SONAMEs but should not have a corresponding SONAME +symlink in the same directory. The paths may contain regular expressions +with escape\-quoted special characters. +.TP \fBQA_DT_NEEDED\fR This should contain a list of file paths, relative to the image directory, of shared libraries that lack NEEDED entries. The paths may contain regular diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py index 156da1aca..6ebe133d4 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -1807,6 +1807,32 @@ def _post_src_install_soname_symlinks(mysettings, out): if f is not None: f.close() + qa_no_symlink = "" + f = None + try: + f = io.open(_unicode_encode(os.path.join( + mysettings["PORTAGE_BUILDDIR"], + "build-info", "QA_SONAME_NO_SYMLINK"), + encoding=_encodings['fs'], errors='strict'), + mode='r', encoding=_encodings['repo.content'], + errors='replace') + qa_no_symlink = f.read() + except IOError as e: + if e.errno not in (errno.ENOENT, errno.ESTALE): + raise + finally: + if f is not None: + f.close() + + qa_no_symlink = qa_no_symlink.split() + if qa_no_symlink: + if len(qa_no_symlink) > 1: + qa_no_symlink = "|".join("(%s)" % x for x in qa_no_symlink) + qa_no_symlink = "^(%s)$" % qa_no_symlink + else: + qa_no_symlink = "^%s$" % qa_no_symlink[0] + qa_no_symlink = re.compile(qa_no_symlink) + libpaths = set(portage.util.getlibpaths( mysettings["ROOT"], env=mysettings)) libpath_inodes = set() @@ -1863,6 +1889,8 @@ def _post_src_install_soname_symlinks(mysettings, out): continue if not is_libdir(os.path.dirname(obj)): continue + if qa_no_symlink and qa_no_symlink.match(obj.strip(os.sep)) is None: + continue obj_file_path = os.path.join(image_dir, obj.lstrip(os.sep)) sym_file_path = os.path.join(os.path.dirname(obj_file_path), soname) -- 2.26.2