[TASK] Use globally defined commands 18/41118/2
authorXavier Perseguers <xavier@typo3.org>
Mon, 13 Jul 2015 09:37:48 +0000 (11:37 +0200)
committerXavier Perseguers <xavier@typo3.org>
Mon, 13 Jul 2015 09:41:07 +0000 (11:41 +0200)
Change-Id: If5062aad0f2af64466d9c7f7b3ed990b488ea818
Reviewed-on: http://review.typo3.org/41118
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
bin/pootle-upgrade-all-extensions
bin/pootle-upgrade-extension

index 361d107..9ad8bf0 100755 (executable)
@@ -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
index dfe5a07..b493d22 100755 (executable)
@@ -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