kde5.eclass: Improve translation handling
authorJohannes Huber <johu@gentoo.org>
Sat, 26 Mar 2016 17:56:55 +0000 (18:56 +0100)
committerMichael Palimaka <kensington@gentoo.org>
Sat, 2 Apr 2016 14:59:21 +0000 (01:59 +1100)
Do not remove unconditionally po file for non release versions.

eclass/kde5.eclass

index 47ced0915868117eb7661c4fa5944f4023242263..db331cbaa5dea01605bfd24400b41917496ea724 100644 (file)
@@ -387,24 +387,24 @@ kde5_src_prepare() {
 
        # enable only the requested translations
        # when required
-       if [[ ${KDE_BUILD_TYPE} = release ]] ; then
-               if [[ -d po ]] ; then
-                       pushd po > /dev/null || die
-                       for lang in *; do
-                               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
-                                       if [[ ${lang} != CMakeLists.txt ]] ; then
-                                               rm ${lang} || die
-                                       fi
+       if [[ -d po ]] ; then
+               pushd po > /dev/null || die
+               for lang in *; do
+                       if [[ -d ${lang} ]] && ! has ${lang} ${LINGUAS} ; then
+                               rm -r ${lang} || die
+                               if [[ -e CMakeLists.txt ]] ; then
+                                       cmake_comment_add_subdirectory ${lang}
                                fi
-                       done
-                       popd > /dev/null || die
-               fi
+                       elif ! has ${lang/.po/} ${LINGUAS} ; then
+                               if [[ ${lang} != CMakeLists.txt ]] ; then
+                                       rm ${lang} || die
+                               fi
+                       fi
+               done
+               popd > /dev/null || die
+       fi
 
+       if [[ ${KDE_BUILD_TYPE} = release ]] ; then
                if [[ ${KDE_HANDBOOK} != false && -d ${KDE_DOC_DIR} && ${CATEGORY} != kde-apps ]] ; then
                        pushd ${KDE_DOC_DIR} > /dev/null || die
                        for lang in *; do
@@ -414,8 +414,6 @@ kde5_src_prepare() {
                        done
                        popd > /dev/null || die
                fi
-       else
-               rm -rf po
        fi
 
        # in frameworks, tests = manual tests so never build them