[TASK] Factor out mapping definition file 47/44047/2 master
authorXavier Perseguers <xavier@typo3.org>
Wed, 14 Oct 2015 09:27:20 +0000 (11:27 +0200)
committerXavier Perseguers <xavier@typo3.org>
Wed, 14 Oct 2015 09:28:10 +0000 (11:28 +0200)
Change-Id: Iadab50ea8f8d9b3c4d8af1a9487b780964f317cd
Reviewed-on: http://review.typo3.org/44047
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
typo3/files/scripts/bin/build-sysext-language-pack

index df57339..b74ac84 100755 (executable)
@@ -8,6 +8,7 @@
 FORCE_EXTENSION=$1
 EXT_PREFIX=TYPO3.core
 EXT_PREFIX_LENGTH=$(($(echo -n ${EXT_PREFIX} | wc -c) + 2))
+
 if [ ! -z "${FORCE_EXTENSION}" ]; then
        EXTENSIONS=${FORCE_EXTENSION}
 else
@@ -39,6 +40,12 @@ for EXTNAME in $EXTENSIONS; do
                echo "   Processing TYPO3 ${VERSION}.x / $(date +'%d.%m.%Y %H:%M:%S')"
                echo "   -------------------------------------------"
 
+               MAPPING=${POOTLE_PO}/${EXT_PREFIX}.${EXTNAME}/.typo3/TYPO3${VERSION}.filemapping
+               if [ ! -f "${MAPPING}" ]; then
+                       echo "Cannot find mapping file '${MAPPING}': skipping TYPO3 ${VERSION}.x."
+                       continue
+               fi
+
                rm -rf ${TER_L10N_PATH}/_$EXTNAME
                UPDATED_PACKAGES=0
                LANGUAGES="$(ls | grep -v templates)"
@@ -105,10 +112,6 @@ for EXTNAME in $EXTENSIONS; do
                                cp -r $ORIG_LANG/* ${BUILD_PATH}
                                pushd ${BUILD_PATH} >/dev/null
                                for XLF in $(find . -type f -name \*.xlf | cut -b3-); do
-                                       MAPPING=${POOTLE_PO}/${EXT_PREFIX}.${EXTNAME}/.typo3/TYPO3${VERSION}.filemapping
-                                       if [ ! -f "${MAPPING}" ]; then
-                                               continue
-                                       fi
                                        TARGET_FILE=$(grep $XLF ${MAPPING} | cut -d' ' -f2)
                                        if [ -z "${TARGET_FILE}" ]; then
                                                echo $XLF | egrep -q '^locallang\.(.*)\.xlf$';