Commit 5ba47a74 authored by Xavier Perseguers's avatar Xavier Perseguers
Browse files

[TASK] Various enhancements

- Better variable naming
- Invisible build directory ("." instead of "_" prefix)
- Speed up packaging by clever use of sync_stores)

Change-Id: If9c5e8e3851b85bdee95012279b85c7a5846c50c
Reviewed-on: http://review.typo3.org/42073

Reviewed-by: Xavier Perseguers's avatarXavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers's avatarXavier Perseguers <xavier@typo3.org>
parent 37a6afd8
......@@ -28,8 +28,9 @@ for EXTNAME in $EXTENSIONS; do
pushd ${POOTLE_PO}/$EXT_PREFIX.$EXTNAME >/dev/null
rm -rf ${TER_L10N_PATH}/_$EXTNAME
_LANGUAGE_PACK_PATH=${TER_L10N_PATH}/${EXTNAME:0:1}/${EXTNAME:1:1}/${EXTNAME}-l10n
mkdir -p $_LANGUAGE_PACK_PATH
LANGUAGE_PACK_PATH=${TER_L10N_PATH}/${EXTNAME:0:1}/${EXTNAME:1:1}/${EXTNAME}-l10n
BUILD_EXT_PATH=${TER_L10N_PATH}/.$EXTNAME
mkdir -p $LANGUAGE_PACK_PATH
mkdir -p $STATE_DIR/$EXT_PREFIX.$EXTNAME
UPDATED_PACKAGES=0
......@@ -73,7 +74,6 @@ for EXTNAME in $EXTENSIONS; do
esac
echo -n " processing $LANG ... "
${POOTLE_MANAGE} sync_stores --overwrite --project="$EXT_PREFIX.$EXTNAME" --language=$ORIG_LANG >/dev/null 2>&1
# Compute current state
STATUS_FILE=$STATE_DIR/$EXT_PREFIX.$EXTNAME/$LANG.time
......@@ -84,9 +84,12 @@ for EXTNAME in $EXTENSIONS; do
fi
LAST_EDIT=$(lastedit "$EXT_PREFIX.$EXTNAME" $ORIG_LANG)
if [[ $LAST_EDIT -gt 0 && $LAST_EDIT -ne $LAST_GENERATION ]]; then
mkdir -p ${TER_L10N_PATH}/_$EXTNAME/$LANG/$EXTNAME
cp -r $ORIG_LANG/* ${TER_L10N_PATH}/_$EXTNAME/$LANG/$EXTNAME
pushd ${TER_L10N_PATH}/_$EXTNAME/$LANG/$EXTNAME >/dev/null
${POOTLE_MANAGE} sync_stores --overwrite --project="$EXT_PREFIX.$EXTNAME" --language=$ORIG_LANG >/dev/null 2>&1
BUILD_PATH=${BUILD_EXT_PATH}/$LANG/$EXTNAME
mkdir -p ${BUILD_PATH}
cp -r $ORIG_LANG/* ${TEMP_PATH}
pushd ${BUILD_PATH} >/dev/null
for XLF in $(find . -type f | cut -b3-); do
DIR=$(dirname $XLF)
FILE=$(basename $XLF)
......@@ -102,11 +105,11 @@ for EXTNAME in $EXTENSIONS; do
done
find . -name \*.xlf -exec chmod 644 {} \;
find . -name \*.xml -exec chmod 644 {} \;
rm -f $_LANGUAGE_PACK_PATH/$EXTNAME-l10n-$LANG.zip
rm -f $LANGUAGE_PACK_PATH/$EXTNAME-l10n-$LANG.zip
# ../ to include $EXTNAME directory
cd ../
zip -9 $_LANGUAGE_PACK_PATH/$EXTNAME-l10n-$LANG.zip -r . >/dev/null
chmod 644 ${_LANGUAGE_PACK_PATH}/${EXTNAME}-l10n-${LANG}.zip
zip -9 $LANGUAGE_PACK_PATH/$EXTNAME-l10n-$LANG.zip -r . >/dev/null
chmod 644 ${LANGUAGE_PACK_PATH}/${EXTNAME}-l10n-${LANG}.zip
popd >/dev/null
......@@ -121,7 +124,7 @@ for EXTNAME in $EXTENSIONS; do
if [ ${UPDATED_PACKAGES} -eq 1 ]; then
# Create language pack index
pushd $_LANGUAGE_PACK_PATH >/dev/null
pushd $LANGUAGE_PACK_PATH >/dev/null
_LANGUAGE_PACK_NAME=${EXTNAME}-l10n
_LANGUAGE_INDEX_FILE=${_LANGUAGE_PACK_NAME}.xml
......
......@@ -27,8 +27,9 @@ for EXTNAME in $EXTENSIONS; do
pushd ${POOTLE_PO}/$EXT_PREFIX.$EXTNAME >/dev/null
_LANGUAGE_PACK_PATH=${TER_L10N_PATH}/${EXTNAME:0:1}/${EXTNAME:1:1}/${EXTNAME}-l10n
mkdir -p $_LANGUAGE_PACK_PATH
LANGUAGE_PACK_PATH=${TER_L10N_PATH}/${EXTNAME:0:1}/${EXTNAME:1:1}/${EXTNAME}-l10n
BUILD_EXT_PATH=${TER_L10N_PATH}/.$EXTNAME
mkdir -p $LANGUAGE_PACK_PATH
mkdir -p $STATE_DIR/$EXT_PREFIX.$EXTNAME
for VERSION in $(find .typo3 -name \*.filemapping | sed -r 's/^.*TYPO3(v.)\.filemapping/\1/'); do
......@@ -85,7 +86,6 @@ for EXTNAME in $EXTENSIONS; do
esac
echo -n " processing $LANG ... "
${POOTLE_MANAGE} sync_stores --overwrite --project="$EXT_PREFIX.$EXTNAME" --language=$ORIG_LANG >/dev/null 2>&1
# Compute current state
STATUS_FILE=$STATE_DIR/$EXT_PREFIX.$EXTNAME/$LANG.${VERSION}.time
......@@ -96,9 +96,12 @@ for EXTNAME in $EXTENSIONS; do
fi
LAST_EDIT=$(lastedit "$EXT_PREFIX.$EXTNAME" $ORIG_LANG)
if [[ $LAST_EDIT -gt 0 && $LAST_EDIT -ne $LAST_GENERATION ]]; then
mkdir -p ${TER_L10N_PATH}/_$EXTNAME/$LANG/$EXTNAME
cp -r $ORIG_LANG/* ${TER_L10N_PATH}/_$EXTNAME/$LANG/$EXTNAME
pushd ${TER_L10N_PATH}/_$EXTNAME/$LANG/$EXTNAME >/dev/null
${POOTLE_MANAGE} sync_stores --overwrite --project="$EXT_PREFIX.$EXTNAME" --language=$ORIG_LANG >/dev/null 2>&1
BUILD_PATH=${BUILD_EXT_PATH}/$LANG/$EXTNAME
mkdir -p ${BUILD_PATH}
cp -r $ORIG_LANG/* ${TEMP_PATH}
pushd ${BUILD_PATH} >/dev/null
for XLF in $(find . -type f | cut -b3-); do
MAPPING=${POOTLE_PO}/${EXT_PREFIX}.${EXTNAME}/.typo3/TYPO3${VERSION}.filemapping
if [ ! -f "${MAPPING}" ]; then
......@@ -165,11 +168,11 @@ EOT
done
find . -name \*.xlf -exec chmod 644 {} \;
find . -name \*.xml -exec chmod 644 {} \;
rm -f ${_LANGUAGE_PACK_PATH}/${EXTNAME}-l10n-${LANG}${SUFFIX}.zip
rm -f ${LANGUAGE_PACK_PATH}/${EXTNAME}-l10n-${LANG}${SUFFIX}.zip
# ../ to include $EXTNAME directory
cd ../
zip -9 ${_LANGUAGE_PACK_PATH}/${EXTNAME}-l10n-${LANG}${SUFFIX}.zip -r . >/dev/null
chmod 644 ${_LANGUAGE_PACK_PATH}/${EXTNAME}-l10n-${LANG}${SUFFIX}.zip
zip -9 ${LANGUAGE_PACK_PATH}/${EXTNAME}-l10n-${LANG}${SUFFIX}.zip -r . >/dev/null
chmod 644 ${LANGUAGE_PACK_PATH}/${EXTNAME}-l10n-${LANG}${SUFFIX}.zip
popd >/dev/null
......@@ -184,7 +187,7 @@ EOT
if [ ${UPDATED_PACKAGES} -eq 1 ]; then
# Create language pack index
pushd $_LANGUAGE_PACK_PATH >/dev/null
pushd $LANGUAGE_PACK_PATH >/dev/null
_LANGUAGE_PACK_NAME=${EXTNAME}-l10n
_LANGUAGE_INDEX_FILE=${_LANGUAGE_PACK_NAME}${SUFFIX}.xml
......@@ -225,7 +228,7 @@ EOT
chmod 755 ${TER_L10N_PATH}/${EXTNAME:0:1}
fi
rm -rf ${TER_L10N_PATH}/_$EXTNAME
rm -rf ${BUILD_EXT_PATH}
done
popd >/dev/null
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment