File indexing completed on 2023-05-30 10:41:17

0001 #!/bin/sh
0002 # Automate the build of the source dist
0003 # This script creates a branch, integrate the po and
0004 # create the tarball
0005 #
0006 
0007 if [ ! -f org.kde.gcompris.appdata.xml ]
0008 then
0009     echo "ERROR: Run me from the top level GCompris source dir"
0010     exit 1
0011 fi
0012 
0013 # The current version
0014 version=$(sed -n -e 's/set(GCOMPRIS_MINOR_VERSION \([0-9]\+\)).*/\1/p' CMakeLists.txt)
0015 curbranch=$(git rev-parse --abbrev-ref HEAD)
0016 
0017 # Uncomment if this is not already done
0018 git checkout -b 0.${version}-po
0019 mkdir -p build
0020 cd build
0021 cmake ..
0022 make getSvnTranslations
0023 
0024 # remove all translation files that should not be shipped
0025 # get all the locales to keep from LanguageList.qml
0026 languageListToKeep=`grep UTF-8\" ../src/core/LanguageList.qml | grep -v "//" | grep -o '[a-zA-Z_@]*.UTF-8' | cut -d'.' -f1`
0027 fullLanguageList=`echo $languageListToKeep | xargs`
0028 for f in $languageListToKeep; do
0029     # append short locales to the list
0030     fullLanguageList="$fullLanguageList `echo $f | cut -d'_' -f1`"
0031 done
0032 # remove each po file that is not within the previous list
0033 for f in ../po/gcompris_*.po; do
0034     # get the locale from the filename
0035     locale=`echo $f | cut -d'_' -f2- | cut -d'.' -f1`
0036     echo $fullLanguageList | grep -q -w $locale
0037     if [[ $? -ne 0 ]]; then
0038         echo "Removing $locale as it is not shipped within gcompris"
0039         rm -f $f
0040     fi
0041 done
0042 
0043 git add -f ../po
0044 git commit -a -m "PO INTEGRATED / DO NOT PUSH ME"
0045 make dist
0046 git checkout ${curbranch}
0047 git branch -D 0.${version}-po