[gimp] build: fix windows-installer-langs unit test.



commit 407472f0918911da6d5d16988b6f7226aa60b318
Author: Jehan <jehan girinstud io>
Date:   Mon Jan 10 23:58:00 2022 +0100

    build: fix windows-installer-langs unit test.
    
    Also improving a bit the download script by specifying the .isl or .islu
    file extension. It's nicer than trying to download randomly, and also it
    allows to better compare the list of downloaded files with the list in
    gimp3264.iss script.

 build/windows/gitlab-ci/installer-gimp-msys2.sh    | 55 ++++++++++------------
 .../windows/installer/lang/test-installer-langs.sh |  4 +-
 2 files changed, 27 insertions(+), 32 deletions(-)
---
diff --git a/build/windows/gitlab-ci/installer-gimp-msys2.sh b/build/windows/gitlab-ci/installer-gimp-msys2.sh
index 6f5b9cb872..0e34ad6ff3 100644
--- a/build/windows/gitlab-ci/installer-gimp-msys2.sh
+++ b/build/windows/gitlab-ci/installer-gimp-msys2.sh
@@ -12,50 +12,45 @@ cd "${ISCCDIR}/Languages/Unofficial"
 
 download_lang ()
 {
-  lang="$1"
-  rm -f "$lang.isl"
-  rm -f "$lang.islu"
-  wget "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/$lang.isl";
+  langfile="$1"
+  rm -f "$langfile"
+  wget "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/$langfile";
   downloaded="$?"
   if [ $downloaded -ne 0 ]; then
-    wget "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/$lang.islu";
-    downloaded="$?"
-    if [ $downloaded -ne 0 ]; then
-      echo "Download of '$lang.isl(u?)' failed."
-      exit 1
-    fi
+    echo "Download of '$langfile' failed."
+    exit 1
   fi
 }
 
 add_bom ()
 {
-  lang="$1"
-  file "$lang.isl" |grep "with BOM" 2>&1 > /dev/null
+  langfile="$1"
+  file "$langfile" |grep "with BOM" 2>&1 > /dev/null
   has_bom="$?"
   if [ $has_bom -ne 0 ]; then
-    sed -i "1s/^/\xEF\xBB\xBF/" "$lang.isl"
+    sed -i "1s/^/\xEF\xBB\xBF/" "$langfile"
   fi
 }
 
 
-download_lang Basque
-download_lang ChineseSimplified
-download_lang ChineseTraditional
+download_lang Basque.isl
+download_lang ChineseSimplified.isl
+download_lang ChineseTraditional.isl
 # Supposed to be UTF-8 yet missing BOM.
-add_bom ChineseTraditional
-download_lang EnglishBritish
-download_lang Esperanto
-download_lang Greek
-download_lang Hungarian
-download_lang Indonesian
-download_lang Korean
-download_lang Latvian
-download_lang Lithuanian
-download_lang Malaysian
-download_lang Marathi
-download_lang Romanian
-download_lang Swedish
-download_lang Vietnamese
+add_bom ChineseTraditional.isl
+download_lang EnglishBritish.isl
+download_lang Esperanto.isl
+download_lang Greek.isl
+download_lang Hungarian.isl
+download_lang Indonesian.isl
+download_lang Korean.isl
+download_lang Latvian.isl
+download_lang Lithuanian.isl
+download_lang Malaysian.isl
+download_lang Marathi.islu
+download_lang Romanian.isl
+download_lang Swedish.isl
+download_lang Vietnamese.isl
 cd -
 
 # Copy generated language files into the source directory.
diff --git a/build/windows/installer/lang/test-installer-langs.sh 
b/build/windows/installer/lang/test-installer-langs.sh
index d47a4e6048..5c882ea537 100755
--- a/build/windows/installer/lang/test-installer-langs.sh
+++ b/build/windows/installer/lang/test-installer-langs.sh
@@ -52,8 +52,8 @@ INSTALLER_LANGS=`grep -rI '^Name:.*MessagesFile.*Unofficial' ${GIMP_TESTING_ABS_
                  sed 's/^.*Unofficial\\\\\([a-zA-Z_.]*\),.*$/\1/' | sort`
 INSTALLER_LANGS=`echo "$INSTALLER_LANGS" | tr '\n\r' ' '`
 
-PULLED_UNOFFICIAL=`grep '^wget .*Unofficial/' 
${GIMP_TESTING_ABS_TOP_SRCDIR}/build/windows/gitlab-ci/installer-gimp-msys2.sh | \
-                   sed 's$^wget.*Unofficial/\([^.]*.isl.\?\)$\1$' | sort`
+PULLED_UNOFFICIAL=`grep '^download_lang [^(]' 
${GIMP_TESTING_ABS_TOP_SRCDIR}/build/windows/gitlab-ci/installer-gimp-msys2.sh | \
+                   sed 's$^download_lang \([^.]*.isl.\?\)$\1$' | sort`
 PULLED_UNOFFICIAL=`echo "$PULLED_UNOFFICIAL" | tr '\n\r' ' '`
 
 if [ "$INSTALLER_LANGS" = "$PULLED_UNOFFICIAL" ]; then


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]