Bug #318389: check for each examples directory before trying to use it. Also avoid...
authorRobin H. Johnson <robbat2@gentoo.org>
Tue, 11 May 2010 08:19:44 +0000 (08:19 +0000)
committerRobin H. Johnson <robbat2@gentoo.org>
Tue, 11 May 2010 08:19:44 +0000 (08:19 +0000)
eclass/db.eclass

index 81d0d5670c150544cbfcbb7c56c6cea8b4e2f952..b9cfd8c316407edef8005c891b9a382a2496c741 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/db.eclass,v 1.38 2010/05/11 08:00:20 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/db.eclass,v 1.39 2010/05/11 08:19:44 robbat2 Exp $
 # This is a common location for functions used in the sys-libs/db ebuilds
 #
 # Bugs: pauldv@gentoo.org
@@ -79,11 +79,16 @@ db_src_install_doc() {
 db_src_install_examples() {
        if use examples ; then
                local langs="c cxx stl"
-               use java && langs="${langs} java"
+               [[ "${IUSE/java}" != "${IUSE}" ]] \
+                       && use java \
+                       && langs="${langs} java"
                for i in $langs ; do
                        destdir="/usr/share/doc/${PF}/"
-                       dodir "${destdir}"
-                       cp -ra "${S}/../examples_${i}/" "${D}${destdir}/"
+                       src="${S}/../examples_${i}/"
+                       if [ -f "${src}" ]; then
+                               dodir "${destdir}"
+                               cp -ra "${src}" "${D}${destdir}/"
+                       fi
                done
        fi
 }