Add QA_SONAME_NO_SYMLINK for bug #387053.
authorZac Medico <zmedico@gentoo.org>
Fri, 14 Oct 2011 06:14:40 +0000 (23:14 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 14 Oct 2011 06:14:40 +0000 (23:14 -0700)
bin/misc-functions.sh
man/ebuild.5
pym/portage/package/ebuild/doebuild.py

index 882d17165ad65e9359a03ba9339ebdc53193efca..b3e62c5fe3941b4da696a67a4d3a712dde4164c1 100755 (executable)
@@ -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
index 0ad5da1acd4953f8491626b16af989606c367a87..2d58c9e6161d80dc2830d51bb808e55662124916 100644 (file)
@@ -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
index 156da1acabd68cd603014ade00495ea68c06c9af..6ebe133d4fdfd92a98828c9056f0677934428d10 100644 (file)
@@ -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)