kde5.eclass: Don't remove cmake_modules, simplify filtering LINGUAS
authorAndreas Sturmlechner <asturm@gentoo.org>
Wed, 17 May 2017 20:26:54 +0000 (22:26 +0200)
committerAndreas Sturmlechner <asturm@gentoo.org>
Sun, 28 May 2017 09:35:02 +0000 (11:35 +0200)
Recent changes in KDE Applications packaging added a new directory
'cmake_modules' for some type of data content inside po/${lang}/

eclass/kde5.eclass

index 60d8f131f1ce646dc19ee39858379e3fc7f6b801..71839733485caab96683ff4c03ca62b21106a62b 100644 (file)
@@ -566,17 +566,18 @@ kde5_src_prepare() {
                        pushd ${po} > /dev/null || die
                        local lang
                        for lang in *; do
-                               if [[ -d ${lang} ]] && ! has ${lang} ${LINGUAS} ; then
-                                       rm -r ${lang} || die
+                               if [[ -e ${lang} ]] && ! has ${lang/.po/} ${LINGUAS} ; then
+                                       case ${lang} in
+                                               cmake_modules | \
+                                               CMakeLists.txt | \
+                                               ${PN}.pot)      ;;
+                                               *) rm -r ${lang} || die ;;
+                                       esac
                                        if [[ -e CMakeLists.txt ]] ; then
                                                cmake_comment_add_subdirectory ${lang}
                                                sed -e "/add_subdirectory([[:space:]]*${lang}\/.*[[:space:]]*)/d" \
                                                        -i CMakeLists.txt || die
                                        fi
-                               elif [[ -f ${lang} ]] && ! has ${lang/.po/} ${LINGUAS} ; then
-                                       if [[ ${lang} != CMakeLists.txt && ${lang} != ${PN}.pot ]] ; then
-                                               rm ${lang} || die
-                                       fi
                                fi
                        done
                        popd > /dev/null || die