commit:     ff16e62967f4afebe715141599170941c24f706f
Author:     Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 16 10:26:50 2014 +0000
Commit:     Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
CommitDate: Sun Nov 16 10:26:50 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/kde.git;a=commit;h=ff16e629

[eclass] Sync kde4-functions with tree

---
 eclass/kde4-functions.eclass | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass
index a8d3550..a5af8bd 100644
--- a/eclass/kde4-functions.eclass
+++ b/eclass/kde4-functions.eclass
@@ -2,6 +2,8 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: $
 
+inherit versionator
+
 # @ECLASS: kde4-functions.eclass
 # @MAINTAINER:
 # [email protected]
@@ -13,14 +15,12 @@
 if [[ -z ${_KDE4_FUNCTIONS_ECLASS} ]]; then
 _KDE4_FUNCTIONS_ECLASS=1
 
-inherit versionator
-
 # @ECLASS-VARIABLE: EAPI
 # @DESCRIPTION:
 # Currently kde4 eclasses support EAPI 4 and 5.
-case ${EAPI} in
+case ${EAPI:-0} in
        4|5) : ;;
-       *) die "EAPI=${EAPI:-0} is not supported" ;;
+       *) die "EAPI=${EAPI} is not supported" ;;
 esac
 
 # @ECLASS-VARIABLE: KDE_OVERRIDE_MINIMAL
@@ -37,13 +37,13 @@ esac
 # This gets set to a non-zero value when a package is considered a kde or
 # kdevelop ebuild.
 if [[ ${CATEGORY} = kde-base ]]; then
+       debug-print "${ECLASS}: KDEBASE ebuild recognized"
        KDEBASE=kde-base
 elif [[ ${KMNAME-${PN}} = kdevelop ]]; then
+       debug-print "${ECLASS}: KDEVELOP ebuild recognized"
        KDEBASE=kdevelop
 fi
 
-debug-print "${ECLASS}: ${KDEBASE} ebuild recognized"
-
 # determine the build type
 if [[ ${PV} = *9999* ]]; then
        KDE_BUILD_TYPE="live"
@@ -121,6 +121,21 @@ buildsycoca() {
        done
 }
 
+# @FUNCTION: comment_add_subdirectory
+# @USAGE: subdirectory
+# @DESCRIPTION:
+# Comment out an add_subdirectory call in CMakeLists.txt in the current 
directory
+comment_add_subdirectory() {
+       if [[ -z ${1} ]]; then
+               die "comment_add_subdirectory must be passed the directory name 
to comment"
+       fi
+
+       if [[ -a "CMakeLists.txt" ]]; then
+               sed -e 
"/add_subdirectory[[:space:]]*([[:space:]]*${1}[[:space:]]*)/s/^/#DONOTCOMPILE 
/" \
+                       -i CMakeLists.txt || die "failed to comment 
add_subdirectory(${1})"
+       fi
+}
+
 # @FUNCTION: comment_all_add_subdirectory
 # @USAGE: [list of directory names]
 # @DESCRIPTION:

Reply via email to