Commit 9e9ae0a8 authored by Xavier Perseguers's avatar Xavier Perseguers
Browse files

[TASK] Use globally defined commands

Change-Id: If5062aad0f2af64466d9c7f7b3ed990b488ea818
Reviewed-on: http://review.typo3.org/41118


Reviewed-by: Xavier Perseguers's avatarXavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers's avatarXavier Perseguers <xavier@typo3.org>
parent aea9a8ff
......@@ -17,9 +17,11 @@ function onexit() {
}
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"
t3xutils.phar updateinfo >/dev/null
$T3XUTILS updateinfo >/dev/null
cd $BASE_DIRECTORY
PROJECTS=$(find . -maxdepth 1 -type d | egrep 'TYPO3\.TYPO3\.ext\.' | sort)
......@@ -29,7 +31,7 @@ do
EXTENSION=$(echo $PROJECT | cut -b19-)
echo -n "[INFO] Looking for latest version of $EXTENSION on TER: "
LASTLINE=$(t3xutils.phar info $EXTENSION 2>/dev/null | grep -v "Available versions:" | tail -n 1)
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"
......@@ -43,7 +45,7 @@ do
fi
if [ -z "$LOCALVERSION" ] || [ "$LOCALVERSION" != "$LASTVERSION" ]; then
echo "[INFO] Updating extension $EXTENSION to version $LASTVERSION"
pootle-upgrade-extension $EXTENSION $LASTVERSION
$UPGRADE_EXTENSION $EXTENSION $LASTVERSION
fi
fi
fi
......
......@@ -16,6 +16,9 @@ function onexit() {
exit $exit_status
}
T3XUTILS=/var/www/vhosts/pootle.typo3.org/home/scripts/bin/t3xutils.phar
POOTLE_MANAGE=/var/www/vhosts/pootle.typo3.org/home/scripts/bin/pootle-manage
# --- check_available_languages() ---------------------------------
# @param $1 string Pootle Project Name
function check_available_languages() {
......@@ -31,7 +34,7 @@ function check_available_languages() {
done
if [ $NEED_UPDATE == 1 ]; then
echo "[NOTICE] Update translation project"
pootle-manage update_translation_projects --project=$1 1>/dev/null 2>/dev/null
$POOTLE_MANAGE update_translation_projects --project=$1 1>/dev/null 2>/dev/null
fi
}
......@@ -78,7 +81,7 @@ wget -q http://typo3.org/fileadmin/ter/${EXTENSION_T3X:0:1}/${EXTENSION_T3X:1:1}
#
# Extract t3x
#extract-t3x $EXTENSION_T3X $EXTENSION > /dev/null
t3xutils.phar extract $EXTENSION_T3X $EXTENSION >/dev/null
$T3XUTILS extract $EXTENSION_T3X $EXTENSION >/dev/null
IFS=$(echo -en "\n\b")
......@@ -136,10 +139,10 @@ check_available_languages $PROJECT_NAME
#
# Update project from templates
echo "[INFO] Update from templates"
pootle-manage update_from_templates --project=$PROJECT_NAME 1>/dev/null 2>/dev/null
$POOTLE_MANAGE update_from_templates --project=$PROJECT_NAME 1>/dev/null 2>/dev/null
echo "[INFO] Refresh statistics"
pootle-manage refresh_stats --project=$PROJECT_NAME 1>/dev/null 2>/dev/null
$POOTLE_MANAGE refresh_stats --project=$PROJECT_NAME 1>/dev/null 2>/dev/null
echo "[NOTICE] Register version $VERSION for EXT:$EXTENSION"
echo -n $VERSION > $PROJECT_DIRECTORY/.ter-version
......
Supports Markdown
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