Commit ffbf87d8 authored by Xavier Perseguers's avatar Xavier Perseguers
Browse files

[TASK] Script to update all 3rd party extensions

Change-Id: I6c9cd6b539bec2023f1f8cdce06a945562a1f1da
Reviewed-on: http://review.typo3.org/41503

Reviewed-by: Xavier Perseguers's avatarXavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers's avatarXavier Perseguers <xavier@typo3.org>
parent f2c6416d
#!/usr/bin/env bash
. /home/pootle/scripts/etc/pootle.conf
. /home/pootle/scripts/etc/functions
set -o errtrace
set -o nounset
......@@ -16,36 +19,33 @@ function onexit() {
exit $exit_status
}
BASE_DIRECTORY="/var/www/vhosts/pootle.typo3.org/pootle/po"
T3XUTILS=/var/www/vhosts/pootle.typo3.org/home/scripts/bin/t3xutils.phar
UPGRADE_EXTENSION=/var/www/vhosts/pootle.typo3.org/home/scripts/bin/pootle-upgrade-extension
echo "[INFO] Fetch and cache TER extension metadata"
echo "[INFO] Fetch and cache TER extension metadata"
$T3XUTILS updateinfo >/dev/null
cd $BASE_DIRECTORY
PROJECTS=$(find . -maxdepth 1 -type d | egrep 'TYPO3\.TYPO3\.ext\.' | sort)
pushd ${POOTLE_PO} >/dev/null
PROJECTS=$(find . -maxdepth 1 -name TYPO3.ext.\* -type d | sort)
popd >/dev/null
for PROJECT in $PROJECTS;
for PROJECT in ${PROJECTS};
do
EXTENSION=$(echo $PROJECT | cut -b19-)
EXTENSION=$(echo ${PROJECT} | cut -b13-)
echo -n "[INFO] Looking for latest version of $EXTENSION on TER: "
LASTLINE=$($T3XUTILS info $EXTENSION 2>/dev/null | grep -v "Available versions:" | tail -n 1)
echo -n "[INFO] Looking for latest version of ${EXTENSION} on TER: "
LASTLINE=$(${T3XUTILS} info ${EXTENSION} 2>/dev/null | grep -v "Available versions:" | tail -n 1)
if [ -z "$LASTLINE" ]; then
echo "n/a"
echo "[ERROR] Extension $EXTENSION does not exist on TER"
echo "[ERROR] Extension ${EXTENSION} does not exist on TER"
else
LASTVERSION=$(echo $LASTLINE | awk '{ print $1 }' | egrep '^[0-9.]+$')
if [ -n "$LASTVERSION" ]; then
echo $LASTVERSION
LASTVERSION=$(echo ${LASTLINE} | awk '{ print $1 }' | egrep '^[0-9.]+$')
if [ -n "${LASTVERSION}" ]; then
echo ${LASTVERSION}
LOCALVERSION=""
if [ -f $BASE_DIRECTORY/$PROJECT/.ter-version ]; then
LOCALVERSION=$(cat $BASE_DIRECTORY/$PROJECT/.ter-version)
if [ -f ${POOTLE_PO}/${PROJECT}/.ter-version ]; then
LOCALVERSION=$(cat ${POOTLE_PO}/${PROJECT}/.ter-version)
fi
if [ -z "$LOCALVERSION" ] || [ "$LOCALVERSION" != "$LASTVERSION" ]; then
echo "[INFO] Updating extension $EXTENSION to version $LASTVERSION"
$UPGRADE_EXTENSION $EXTENSION $LASTVERSION
if [ -z "${LOCALVERSION}" ] || [ "${LOCALVERSION}" != "${LASTVERSION}" ]; then
echo "[INFO] Updating extension ${EXTENSION} to version ${LASTVERSION}"
${POOTLE_SCRIPT_HOME}/bin/update-extension ${EXTENSION} ${LASTVERSION}
fi
fi
fi
......
......@@ -88,9 +88,9 @@ function check_available_languages() {
if [ -n "$1" ] && [ ! -d ${POOTLE_PO}/$1/$LANGUAGE_KEY ]; then
mkdir -p $POOTLE_PO/$1/$LANGUAGE_KEY
echo "[NOTICE] Create project language \"$LANGUAGE_KEY\" for \"$1\""
pootle-manage update_translation_projects --project=$1 --language=$LANGUAGE_KEY
pootle-manage update_against_templates --project=$1 --language=$LANGUAGE_KEY
pootle-manage refresh_stats --project=$1 --language=$LANGUAGE_KEY
pootle-manage update_translation_projects --project=$1 --language=$LANGUAGE_KEY >/dev/null 2>&1
pootle-manage update_against_templates --project=$1 --language=$LANGUAGE_KEY >/dev/null 2>&1
pootle-manage refresh_stats --project=$1 --language=$LANGUAGE_KEY >/dev/null 2>&1
fi
done
}
......
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