create symlinks to html documentation if DOC_SYMLINK_DIR is set, original patch by...
authorMarius Mauch <genone@gentoo.org>
Wed, 10 Jan 2007 06:18:13 +0000 (06:18 -0000)
committerMarius Mauch <genone@gentoo.org>
Wed, 10 Jan 2007 06:18:13 +0000 (06:18 -0000)
svn path=/main/trunk/; revision=5509

NEWS
bin/misc-functions.sh
pym/portage.py

diff --git a/NEWS b/NEWS
index dedf2827097f0ae02c321d979794e6c925b9353f..eee71be5b1d3323536d3622ce83dc09f2c10774c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,7 @@ portage-2.1.2
   file/mail.
 * New QA loglevel and matching eqawarn function
 * `ebuild foo test` now always runs src_test if available
+* If DOC_SYMLINK_DIR is set portage installs symlinks to html documention there
 
 portage-2.1.1
 ------------
index 198538d0c6fb3b1b5ced6baf9df1ce7d413c96b4..55428862146f62b12c07c56304e1462577349220 100755 (executable)
@@ -17,6 +17,30 @@ shift $#
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/ebuild.sh"
 
+install_symlink_html_docs() {
+       cd "${D}" || die "cd failed"
+       #symlink the html documentation (if DOC_SYMLINKS_DIR is set in make.conf)
+       if [ -n "${DOC_SYMLINKS_DIR}" ] ; then
+               local mydocdir docdir
+               for docdir in "${HTMLDOC_DIR:-does/not/exist}" "${PF}/html" "${PF}/HTML" "${P}/html" "${P}/HTML" ; do
+                       if [ -d "usr/share/doc/${docdir}" ] ; then
+                               mydocdir="/usr/share/doc/${docdir}"
+                       fi
+               done
+               if [ -n "${mydocdir}" ] ; then
+                       local mysympath
+                       if [ -z "${SLOT}" -o "${SLOT}" = "0" ] ; then
+                               mysympath="${DOC_SYMLINKS_DIR}/${CATEGORY}/${PN}"
+                       else
+                               mysympath="${DOC_SYMLINKS_DIR}/${CATEGORY}/${PN}-${SLOT}"
+                       fi
+                       einfo "Symlinking ${mysympath} to the HTML documentation"
+                       dodir "${DOC_SYMLINKS_DIR}/${CATEGORY}"
+                       dosym "${mydocdir}" "${mysympath}"
+               fi
+       fi
+}
+
 install_qa_check() {
        cd "${D}" || die "cd failed"
        prepall
index 056a4c8501f05a5d03a5cc03a5ad35f0853e3417..3f3e378ae42182064b1e0258f1c34469ddec7ad5 100644 (file)
@@ -2841,7 +2841,7 @@ def spawnebuild(mydo,actionmap,mysettings,debug,alwaysdep=0,logfile=None):
                                        apply_secpass_permissions(fpath, uid=myuid, gid=mygid,
                                                mode=mystat.st_mode, stat_cached=mystat,
                                                follow_links=False)
-                       mycommand = " ".join([MISC_SH_BINARY, "install_qa_check"])
+                       mycommand = " ".join([MISC_SH_BINARY, "install_qa_check", "install_symlink_html_docs"])
                        qa_retval = spawn(mycommand, mysettings, debug=debug, logfile=logfile, **kwargs)
                        if qa_retval:
                                writemsg("!!! install_qa_check failed; exiting.\n",