kde5.eclass: Don't delete po/*.po files, only when not in LINGUAS
authorAndreas Sturmlechner <andreas.sturmlechner@gmail.com>
Wed, 2 Mar 2016 01:40:00 +0000 (02:40 +0100)
committerMichael Palimaka <kensington@gentoo.org>
Sat, 12 Mar 2016 17:00:29 +0000 (04:00 +1100)
eclass/kde5.eclass

index fd83a7109cb95c6c18f4abc2ab20512ef47e9634..9356f3921f257b388a11ee87318829be662eb9de 100644 (file)
@@ -387,13 +387,13 @@ kde5_src_prepare() {
                if [[ -d po ]] ; then
                        pushd po > /dev/null || die
                        for lang in *; do
-                               if ! has ${lang} ${LINGUAS} ; then
-                                       if [[ ${lang} != CMakeLists.txt ]] ; then
-                                               rm -rf ${lang}
-                                       fi
+                               if [[ -d ${lang} ]] && ! has ${lang} ${LINGUAS} ; then
+                                       rm -r ${lang} || die
                                        if [[ -e CMakeLists.txt ]] ; then
                                                cmake_comment_add_subdirectory ${lang}
                                        fi
+                               elif ! has ${lang/.po/} ${LINGUAS} ; then
+                                       rm ${lang} || die
                                fi
                        done
                        popd > /dev/null || die