[!!!][TASK] Support multiple branches of TYPO3 sources 21/41121/2
authorXavier Perseguers <xavier@typo3.org>
Mon, 13 Jul 2015 09:40:07 +0000 (11:40 +0200)
committerXavier Perseguers <xavier@typo3.org>
Mon, 13 Jul 2015 09:42:02 +0000 (11:42 +0200)
Change-Id: Ic44f29e83e5d9386def0cf570e86f1b098c79990
Reviewed-on: http://review.typo3.org/41121
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
bin/update-typo3-core-template

index edd7ae0..97d93e2 100755 (executable)
@@ -69,42 +69,52 @@ function update_typo3_typo3_core_projects() {
 
 function git_typo3_typo3_core_pull() {
        echo
-       echo "TYPO3 Core GIT Pull"
+       echo "TYPO3 Core GIT Pull from $1"
        cd $GIT_DIRECTORY
+       git checkout master
+       git reset --hard origin/master
+       git fetch
+       git checkout $1
        git pull
-       git submodule init
-       git submodule update
 }
 
-# GIT pull
-git_typo3_typo3_core_pull
-
-# Check project language configuration
-check_typo3_typo3_core_projects_languages
-
-echo
-echo "Update templates projects ..."
-for FILE in $(find $GIT_DIRECTORY/ -name *.xlf | grep sysext); do
-       RELATIVE_FILE_PATH=$(echo $FILE | sed s#$GIT_DIRECTORY/## | cut -d/ -f4-)
-       PROJECT=$(echo TYPO3.TYPO3.core.$(echo $FILE | sed s#$GIT_DIRECTORY/## | cut -d/ -f3))
-       echo "$PROJECT/$RELATIVE_FILE_PATH"
-
-       # Check project configuration
-       project_exist $PROJECT || exit 0
-
-       # Update project templates
-       if [ $? = 0 ]; then
-               # Check if directory exist
-               RELATIVE_FILE_DIRECTORY=$(dirname $PO_DIRECTORY/$PROJECT/templates/$RELATIVE_FILE_PATH);
-               if [ ! -d $RELATIVE_FILE_DIRECTORY ]; then
-                       echo "Create directory: $RELATIVE_FILE_DIRECTORY"
-                       mkdir -p $RELATIVE_FILE_DIRECTORY
-               fi
+# We successively fetch from old to newer branches to get back files which
+# may have been moved around. BEWARE: labels should not get deleted (well,
+# possible if file is moved as well) and "templates" language MUST be
+# manually updated (in GUI) to discover new files before they are mirrored
+# to other locales
+#for BRANCH in 'TYPO3_4-5' 'TYPO3_6-2'; do
+for BRANCH in 'TYPO3_6-2'; do
+       # GIT pull
+       git_typo3_typo3_core_pull $BRANCH
 
-               # Deploy file from GIT
-               sanitize_template_file $FILE > \
-                       $PO_DIRECTORY/$PROJECT/templates/$RELATIVE_FILE_PATH
-       fi
+       # Check project language configuration
+       check_typo3_typo3_core_projects_languages
+
+       echo
+       echo "Update templates projects ..."
+       for FILE in $(find $GIT_DIRECTORY/ -name *.xlf | grep sysext); do
+               RELATIVE_FILE_PATH=$(echo $FILE | sed s#$GIT_DIRECTORY/## | cut -d/ -f4-)
+               PROJECT=$(echo TYPO3.TYPO3.core.$(echo $FILE | sed s#$GIT_DIRECTORY/## | cut -d/ -f3))
+               echo "$PROJECT/$RELATIVE_FILE_PATH"
+
+               # Check project configuration
+               project_exist $PROJECT || exit 0
+
+               # Update project templates
+               if [ $? = 0 ]; then
+                       # Check if directory exist
+                       RELATIVE_FILE_DIRECTORY=$(dirname $PO_DIRECTORY/$PROJECT/templates/$RELATIVE_FILE_PATH);
+                       if [ ! -d $RELATIVE_FILE_DIRECTORY ]; then
+                               echo "Create directory: $RELATIVE_FILE_DIRECTORY"
+                               mkdir -p $RELATIVE_FILE_DIRECTORY
+                       fi
+
+                       # Deploy file from GIT
+                       sanitize_template_file $FILE > \
+                               $PO_DIRECTORY/$PROJECT/templates/$RELATIVE_FILE_PATH
+               fi
+       done
 done
 
 # Update all core project