TranslateDesktop: Use -a switch in grep commands
authorPalo Kisa <palo.kisa@gmail.com>
Fri, 12 Feb 2016 07:11:41 +0000 (08:11 +0100)
committerPalo Kisa <palo.kisa@gmail.com>
Fri, 12 Feb 2016 07:11:41 +0000 (08:11 +0100)
As of grep v2.23 some translation files are considered as binary (maybe because of some locale settings)
and then the created .desktop file is malformed. So we force the grep to handle all provided input
files as text.

closes lxde/lxqt#957

cmake/modules/LXQtTranslateDesktop.cmake

index e770b63..217400a 100644 (file)
@@ -71,13 +71,13 @@ function(lxqt_translate_desktop _RESULT)
         if (_translations)
             list(SORT _translations)
             add_custom_command(OUTPUT ${_outFile}
-                COMMAND grep -v "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
-                COMMAND grep -h ${_pattern} ${_translations} >> ${_outFile}
+                COMMAND grep -v -a "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
+                COMMAND grep -h -a ${_pattern} ${_translations} >> ${_outFile}
                 COMMENT "Generating ${_fileName}${_fileExt}"
             )
         else()
             add_custom_command(OUTPUT ${_outFile}
-                COMMAND grep -v "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
+                COMMAND grep -v -a "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
                 COMMENT "Generating ${_fileName}${_fileExt}"
             )
         endif()