[!!!][TASK] Move typo3/sysext/core/Build/Scripts to Build/Scripts 29/51729/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 17 Feb 2017 01:13:04 +0000 (02:13 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 17 Feb 2017 01:35:51 +0000 (02:35 +0100)
This moves all maintenance / check / test scripts from
typo3/sysext/core/Build/Scripts to Build/Scripts.
This is possible now after the test framework extraction.
The artifical Build folder of typo3/sysext/core vanishes and
all core related integrity and code sanitation scripts are
now located next to all other main core build relevant stuff.

This patch is only breaking for core devs who executed one
of the scripts, most notably the "cglFixMyCommit.sh" script.
Path is now:

./Build/Scripts/cglFixMyCommit.sh

Change-Id: I8272d3d18c5e4164d67df8831168476f315db285
Resolves: #79869
Releases: master
Reviewed-on: https://review.typo3.org/51729
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Build/Scripts/cglFixMyCommit.sh [new file with mode: 0755]
Build/Scripts/checkFilePermissions.sh [new file with mode: 0755]
Build/Scripts/duplicateExceptionCodeCheck.sh [new file with mode: 0755]
Build/Scripts/validateRstFiles.sh [new file with mode: 0755]
Build/Scripts/xlfcheck.sh [new file with mode: 0755]
typo3/sysext/core/Build/Scripts/cglFixMyCommit.sh [deleted file]
typo3/sysext/core/Build/Scripts/checkFilePermissions.sh [deleted file]
typo3/sysext/core/Build/Scripts/duplicateExceptionCodeCheck.sh [deleted file]
typo3/sysext/core/Build/Scripts/validateRstFiles.sh [deleted file]
typo3/sysext/core/Build/Scripts/xlfcheck.sh [deleted file]

diff --git a/Build/Scripts/cglFixMyCommit.sh b/Build/Scripts/cglFixMyCommit.sh
new file mode 100755 (executable)
index 0000000..7aa80e5
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+#########################
+#
+# CGL check latest core commit.
+#
+# It expects to be run from the core root.
+#
+# To auto-fix single files, use the php-cs-fixer command directly
+# substitute $FILE with a filename
+#
+##########################
+
+COUNTER=0
+DRYRUN=""
+
+if [ "$1" = "dryrun" ]
+then
+    DRYRUN="--dry-run"
+fi
+
+for FILE in $(git diff-tree --no-commit-id --name-only -r HEAD | grep '.php$'); do
+    if [ -e $FILE ]
+    then
+        ./bin/php-cs-fixer fix $FILE \
+            -v $DRYRUN \
+            --config=Build/.php_cs
+
+        if [ "$?" -gt "0" ]
+        then
+            COUNTER=$((COUNTER+1))
+        fi
+    fi
+done
+
+if [ ${COUNTER} -gt 0 ] ; then
+    echo "$COUNTER number of files are not CGL clean. Check $0 to find out what is going wrong."
+    exit 1
+fi
+
+exit 0
diff --git a/Build/Scripts/checkFilePermissions.sh b/Build/Scripts/checkFilePermissions.sh
new file mode 100755 (executable)
index 0000000..9d9fa23
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+#########################
+#
+# Check all files for their file permission.
+# An array of files to be excluded is in place.
+#
+# It expects to be run from the core root.
+#
+##########################
+
+# Array of files to ignore the file permission check
+IGNORE=(
+  "typo3/cli_dispatch.phpsh"
+  "typo3/sysext/core/bin/typo3"
+)
+
+COUNTER=0
+
+for FILE in $(find typo3/ -type f ! -perm 0644); do
+    if ! [[ ${IGNORE[*]} =~ "$FILE" ]]
+    then
+        echo $FILE
+        COUNTER=$((COUNTER+1))
+    fi
+done
+
+if [ ${COUNTER} -gt 0 ] ; then
+    echo "$COUNTER number of files have a wrong file permission set."
+    exit 1
+fi
+
+exit 0
diff --git a/Build/Scripts/duplicateExceptionCodeCheck.sh b/Build/Scripts/duplicateExceptionCodeCheck.sh
new file mode 100755 (executable)
index 0000000..8fda8c2
--- /dev/null
@@ -0,0 +1,86 @@
+#!/bin/bash
+
+#########################
+#
+# Find duplicate exception timestamps and list them.
+# Additionally find exceptions that have no exception code.
+#
+# It expects to be run from the core root.
+#
+##########################
+
+cd typo3/
+
+ignoreFiles=()
+# auto generated file, shouldn't be checked
+ignoreFiles+="sysext/core/Build/Configuration/Acceptance/Support/_generated/AcceptanceTesterActions.php"
+# a exception in here throws up an code from a previous exception
+ignoreFiles+="sysext/extbase/Classes/Core/Bootstrap.php"
+
+foundNewFile=0
+oldFilename=""
+firstLineOfMatch=""
+foundExceptionInFile=1
+exceptionCodes=()
+
+# grep
+# '-r' recursive
+# '--include '*.php'' in all .php files
+# '-Pzoab' pcre regex, -zo remove all linebreaks for multiline match, treat all files as text, output position "filename:position: match", binary position
+#
+# (?:(?!Exception\()[\w\\])*  negative lookahead. capture all alphanum and \ until we reach "Exception("
+# eat "Exception("
+# (?:(?!\);).|[\r\n])*\);[\r\n]+   negative lookahead again, eat everything including a \n until we reach the first ");", then line breaks
+
+grep \
+    -r \
+    --include '*.php' \
+    -Pzoab \
+    'new (?:(?!Exception\()[\w\\])*Exception\((?:(?!\);).|[\r\n])*\);[\r\n]+' \
+    | \
+while read line;
+do
+    possibleFilename=`echo ${line} | cut -d':' -f1`
+    if [[ ${possibleFilename} =~ .php$ ]]; then
+        # the matched line consists of a file name match, we're dealing with a new match here.
+        foundNewFile=1
+        oldFilename=${currentFilename}
+        currentFilename=${possibleFilename}
+    else
+        foundNewFile=0
+    fi
+
+    # skip file if in blacklist
+    if [[ {$ignoreFiles[@]} =~ ${currentFilename} ]]; then
+        continue
+    fi
+
+    # check for match in previous file name
+    if [[ ${foundNewFile} -eq 1 ]] && [[ ${foundExceptionInFile} -eq 0 ]]; then
+        echo "File: $oldFilename"
+        echo "The created exception contains no 10 digit exception code as second argument, in or below this line:"
+        echo "$firstLineOfMatch"
+        exit 1
+    fi
+
+    # reset found flag if we're handling new file
+    if [[ ${foundNewFile} -eq 1 ]]; then
+        foundExceptionInFile=0
+        firstLineOfMatch=${line}
+    fi
+
+    # see if the line consists of an exception code
+    if [[ "$line" =~ .*([0-9]{10}).* ]]; then
+        foundExceptionInFile=1
+        exceptionCode=${BASH_REMATCH[1]}
+        # check if that code was registered already
+        if [[ {$exceptionCodes[@]} =~ ${exceptionCode} ]]; then
+            echo "Duplicate exception code ${exceptionCode} in file:"
+            echo ${currentFilename}
+            exit 1
+        fi
+        exceptionCodes+=${exceptionCode}
+    fi
+done || exit 1
+
+exit 0
\ No newline at end of file
diff --git a/Build/Scripts/validateRstFiles.sh b/Build/Scripts/validateRstFiles.sh
new file mode 100755 (executable)
index 0000000..64c9649
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+#########################
+#
+# Check all rst snippets
+# in typo3/sysext/core/Documentation/Changelog
+#
+# It expects to be run from the core root.
+#
+##########################
+
+echo 'Searching for rst snippets'
+EXT=rst
+COUNT=0
+for i in `find typo3/sysext/core/Documentation/Changelog -name "*.rst" -type f`; do
+    if [[ "${i}" != "${i%.${EXT}}" && ! $i =~ 'Index.rst' &&  ! $i =~ 'Howto.rst' ]];then
+
+
+        fileContent=$(cat $i);
+        outputFileToStream=0;
+
+# This regex needs to allow whitespace and/or newlines before the .. include:: ../../Includes.txt
+# The regex itself is correct, bash doesn't like it
+        if ! [[ "$fileContent" =~ ^[[:space:]]*'.. include:: ../../Includes.txt' ]]; then
+            INCLUDE="no include"
+            include_message="insert '.. include:: ../../Includes.txt' in first line of the file"
+            outputFileToStream=1;
+        else
+            INCLUDE=""
+        fi
+
+# This regex seems to have problems with the backtick characters.
+# Maybe this is because it somehow interprets them from the variable $fileContent
+        if ! [[ "$fileContent" =~ 'See :issue:'\`([0-9]{4,6})\` ]]; then
+            REFERENCE="no reference"
+            reference_message="insert 'See :issue:\`<issuenumber>\`' after headline"
+            outputFileToStream=1;
+        else
+            REFERENCE=""
+        fi
+
+# This regex needs to check that the ..index:: line a) holds valid content and b) is
+# the last line in the checked file
+        if ! [[ "$fileContent" =~ '.. index:: '((TypoScript|TSConfig|TCA|FlexForm|LocalConfiguration|Fluid|FAL|Database|JavaScript|PHP-API|Frontend|Backend|CLI|RTE|ext:([a-z|A-Z|_|0-9]*))([,|[:space:]]{2})?)+$ ]]; then
+            INDEX="no or wrong index"
+            index_message="insert '.. index:: <at least one keyword>' at last line of the file"
+            outputFileToStream=1;
+        else
+            INDEX=""
+        fi
+        # Output filename in case any error was found
+        if [ $outputFileToStream == 1 ] ; then
+            FILE=${i/#typo3\/sysext\/core\/Documentation\/Changelog\//}
+            let COUNT++
+            printf "%-10s | %-12s | %-17s | %s \n" "$INCLUDE" "$REFERENCE" "$INDEX" "$FILE";
+            if ! [[ -z ${include_message} ]] ; then
+            echo ${include_message};
+            fi
+            if ! [[ -z ${reference_message} ]] ; then
+            echo ${reference_message};
+            fi
+            if ! [[ -z ${index_message} ]] ; then
+            echo ${index_message};
+            fi
+        fi
+    fi
+
+done
+if [[ $COUNT > 0 ]]; then
+     >&2 echo "Found $COUNT rst files with errors, check full log for details.";
+     exit 1;
+   else
+     exit 0;
+fi
diff --git a/Build/Scripts/xlfcheck.sh b/Build/Scripts/xlfcheck.sh
new file mode 100755 (executable)
index 0000000..00c60a7
--- /dev/null
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+#########################
+#
+# Find all xmlns:t3 namespace definition and
+# t3:id numbers in XLF language files
+# and check their uniqueness.
+#
+# It expects to be run from the core root.
+#
+##########################
+
+XLF_FILES="xlffiles.txt"
+XLF_IDS="xlfids.txt"
+XLF_XMLNS="xlfxmlns.txt"
+
+function join { local IFS="$1"; shift; echo "$*"; }
+
+echo 'Collecting XLF files'
+find typo3/ -name '*.xlf' > $XLF_FILES
+XLFCNT=$(cat xlffiles.txt | wc -l)
+
+# Check for xmlns
+echo 'Extracting xmlns:t3 information'
+sed -ne 's/.*\(xmlns:t3="http:\/\/typo3.org\/schemas\/xliff"\)/\1/pg' `cat $XLF_FILES` | sort > $XLF_XMLNS
+XLFXMLNSCNT=$(cat $XLF_XMLNS | wc -l)
+DIFFXMLNS=$(join , $(uniq -d $XLF_XMLNS))
+MISSINGXMLNS=$(join , $(grep -L 'xmlns:t3="http://typo3.org/schemas/xliff"' `cat $XLF_FILES`))
+
+# Checks for t3:id
+echo 'Extracting t3:id information'
+sed -ne 's/.*t3:id="\([0-9]\+\)".*/\1/pg' `cat $XLF_FILES` | sort > $XLF_IDS
+
+echo 'Processing ids'
+XLFIDCNT=$(cat $XLF_IDS | wc -l)
+UXLFIDCNT=$(uniq $XLF_IDS | wc -l)
+DIFFIDS=$(join , $(uniq -d $XLF_IDS))
+MISSINGIDS=$(join , $(grep -L 't3:id' `cat $XLF_FILES`))
+
+# Cleanup of temporary files
+rm $XLF_IDS $XLF_FILES $XLF_XMLNS
+
+if [ $XLFCNT -ne $XLFXMLNSCNT ];
+then
+       echo "There is at least one XLF file missing a xmlns for t3 (xmlns:t3)."
+       echo "Missing in: $MISSINGXMLNS"
+       exit 1
+fi
+
+if [ $XLFCNT -ne $XLFIDCNT ];
+then
+       echo "There is at least one XLF file missing a unique ID (t3:id)."
+       echo "Missing in: $MISSINGIDS"
+       exit 1
+fi
+if [ $XLFIDCNT -ne $UXLFIDCNT ];
+then
+       echo "There is an XLF id that does not seem to be UNIQUE."
+       echo "Search for t3:id $DIFFIDS"
+       exit 1
+fi
+
+exit 0
diff --git a/typo3/sysext/core/Build/Scripts/cglFixMyCommit.sh b/typo3/sysext/core/Build/Scripts/cglFixMyCommit.sh
deleted file mode 100755 (executable)
index 7aa80e5..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-
-#########################
-#
-# CGL check latest core commit.
-#
-# It expects to be run from the core root.
-#
-# To auto-fix single files, use the php-cs-fixer command directly
-# substitute $FILE with a filename
-#
-##########################
-
-COUNTER=0
-DRYRUN=""
-
-if [ "$1" = "dryrun" ]
-then
-    DRYRUN="--dry-run"
-fi
-
-for FILE in $(git diff-tree --no-commit-id --name-only -r HEAD | grep '.php$'); do
-    if [ -e $FILE ]
-    then
-        ./bin/php-cs-fixer fix $FILE \
-            -v $DRYRUN \
-            --config=Build/.php_cs
-
-        if [ "$?" -gt "0" ]
-        then
-            COUNTER=$((COUNTER+1))
-        fi
-    fi
-done
-
-if [ ${COUNTER} -gt 0 ] ; then
-    echo "$COUNTER number of files are not CGL clean. Check $0 to find out what is going wrong."
-    exit 1
-fi
-
-exit 0
diff --git a/typo3/sysext/core/Build/Scripts/checkFilePermissions.sh b/typo3/sysext/core/Build/Scripts/checkFilePermissions.sh
deleted file mode 100755 (executable)
index 731efbd..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-
-#########################
-#
-# Check all files for their file permission.
-# An array of files to be excluded is in place.
-#
-# It expects to be run from the core root.
-#
-##########################
-
-# Array of files to ignore the file permission check
-IGNORE=(
-  "components/testing_framework/core/Build/Scripts/splitFunctionalTests.sh"
-  "typo3/cli_dispatch.phpsh"
-  "typo3/sysext/core/Build/Scripts/cglFixMyCommit.sh"
-  "typo3/sysext/core/Build/Scripts/checkFilePermissions.sh"
-  "typo3/sysext/core/Build/Scripts/duplicateExceptionCodeCheck.sh"
-  "typo3/sysext/core/Build/Scripts/xlfcheck.sh"
-  "typo3/sysext/core/Build/Scripts/validateRstFiles.sh"
-  "typo3/sysext/core/bin/typo3"
-)
-
-COUNTER=0
-
-for FILE in $(find typo3/ -type f ! -perm 0644); do
-    if ! [[ ${IGNORE[*]} =~ "$FILE" ]]
-    then
-        echo $FILE
-        COUNTER=$((COUNTER+1))
-    fi
-done
-
-if [ ${COUNTER} -gt 0 ] ; then
-    echo "$COUNTER number of files have a wrong file permission set."
-    exit 1
-fi
-
-exit 0
diff --git a/typo3/sysext/core/Build/Scripts/duplicateExceptionCodeCheck.sh b/typo3/sysext/core/Build/Scripts/duplicateExceptionCodeCheck.sh
deleted file mode 100755 (executable)
index 8fda8c2..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/bash
-
-#########################
-#
-# Find duplicate exception timestamps and list them.
-# Additionally find exceptions that have no exception code.
-#
-# It expects to be run from the core root.
-#
-##########################
-
-cd typo3/
-
-ignoreFiles=()
-# auto generated file, shouldn't be checked
-ignoreFiles+="sysext/core/Build/Configuration/Acceptance/Support/_generated/AcceptanceTesterActions.php"
-# a exception in here throws up an code from a previous exception
-ignoreFiles+="sysext/extbase/Classes/Core/Bootstrap.php"
-
-foundNewFile=0
-oldFilename=""
-firstLineOfMatch=""
-foundExceptionInFile=1
-exceptionCodes=()
-
-# grep
-# '-r' recursive
-# '--include '*.php'' in all .php files
-# '-Pzoab' pcre regex, -zo remove all linebreaks for multiline match, treat all files as text, output position "filename:position: match", binary position
-#
-# (?:(?!Exception\()[\w\\])*  negative lookahead. capture all alphanum and \ until we reach "Exception("
-# eat "Exception("
-# (?:(?!\);).|[\r\n])*\);[\r\n]+   negative lookahead again, eat everything including a \n until we reach the first ");", then line breaks
-
-grep \
-    -r \
-    --include '*.php' \
-    -Pzoab \
-    'new (?:(?!Exception\()[\w\\])*Exception\((?:(?!\);).|[\r\n])*\);[\r\n]+' \
-    | \
-while read line;
-do
-    possibleFilename=`echo ${line} | cut -d':' -f1`
-    if [[ ${possibleFilename} =~ .php$ ]]; then
-        # the matched line consists of a file name match, we're dealing with a new match here.
-        foundNewFile=1
-        oldFilename=${currentFilename}
-        currentFilename=${possibleFilename}
-    else
-        foundNewFile=0
-    fi
-
-    # skip file if in blacklist
-    if [[ {$ignoreFiles[@]} =~ ${currentFilename} ]]; then
-        continue
-    fi
-
-    # check for match in previous file name
-    if [[ ${foundNewFile} -eq 1 ]] && [[ ${foundExceptionInFile} -eq 0 ]]; then
-        echo "File: $oldFilename"
-        echo "The created exception contains no 10 digit exception code as second argument, in or below this line:"
-        echo "$firstLineOfMatch"
-        exit 1
-    fi
-
-    # reset found flag if we're handling new file
-    if [[ ${foundNewFile} -eq 1 ]]; then
-        foundExceptionInFile=0
-        firstLineOfMatch=${line}
-    fi
-
-    # see if the line consists of an exception code
-    if [[ "$line" =~ .*([0-9]{10}).* ]]; then
-        foundExceptionInFile=1
-        exceptionCode=${BASH_REMATCH[1]}
-        # check if that code was registered already
-        if [[ {$exceptionCodes[@]} =~ ${exceptionCode} ]]; then
-            echo "Duplicate exception code ${exceptionCode} in file:"
-            echo ${currentFilename}
-            exit 1
-        fi
-        exceptionCodes+=${exceptionCode}
-    fi
-done || exit 1
-
-exit 0
\ No newline at end of file
diff --git a/typo3/sysext/core/Build/Scripts/validateRstFiles.sh b/typo3/sysext/core/Build/Scripts/validateRstFiles.sh
deleted file mode 100755 (executable)
index 64c9649..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/bash
-
-#########################
-#
-# Check all rst snippets
-# in typo3/sysext/core/Documentation/Changelog
-#
-# It expects to be run from the core root.
-#
-##########################
-
-echo 'Searching for rst snippets'
-EXT=rst
-COUNT=0
-for i in `find typo3/sysext/core/Documentation/Changelog -name "*.rst" -type f`; do
-    if [[ "${i}" != "${i%.${EXT}}" && ! $i =~ 'Index.rst' &&  ! $i =~ 'Howto.rst' ]];then
-
-
-        fileContent=$(cat $i);
-        outputFileToStream=0;
-
-# This regex needs to allow whitespace and/or newlines before the .. include:: ../../Includes.txt
-# The regex itself is correct, bash doesn't like it
-        if ! [[ "$fileContent" =~ ^[[:space:]]*'.. include:: ../../Includes.txt' ]]; then
-            INCLUDE="no include"
-            include_message="insert '.. include:: ../../Includes.txt' in first line of the file"
-            outputFileToStream=1;
-        else
-            INCLUDE=""
-        fi
-
-# This regex seems to have problems with the backtick characters.
-# Maybe this is because it somehow interprets them from the variable $fileContent
-        if ! [[ "$fileContent" =~ 'See :issue:'\`([0-9]{4,6})\` ]]; then
-            REFERENCE="no reference"
-            reference_message="insert 'See :issue:\`<issuenumber>\`' after headline"
-            outputFileToStream=1;
-        else
-            REFERENCE=""
-        fi
-
-# This regex needs to check that the ..index:: line a) holds valid content and b) is
-# the last line in the checked file
-        if ! [[ "$fileContent" =~ '.. index:: '((TypoScript|TSConfig|TCA|FlexForm|LocalConfiguration|Fluid|FAL|Database|JavaScript|PHP-API|Frontend|Backend|CLI|RTE|ext:([a-z|A-Z|_|0-9]*))([,|[:space:]]{2})?)+$ ]]; then
-            INDEX="no or wrong index"
-            index_message="insert '.. index:: <at least one keyword>' at last line of the file"
-            outputFileToStream=1;
-        else
-            INDEX=""
-        fi
-        # Output filename in case any error was found
-        if [ $outputFileToStream == 1 ] ; then
-            FILE=${i/#typo3\/sysext\/core\/Documentation\/Changelog\//}
-            let COUNT++
-            printf "%-10s | %-12s | %-17s | %s \n" "$INCLUDE" "$REFERENCE" "$INDEX" "$FILE";
-            if ! [[ -z ${include_message} ]] ; then
-            echo ${include_message};
-            fi
-            if ! [[ -z ${reference_message} ]] ; then
-            echo ${reference_message};
-            fi
-            if ! [[ -z ${index_message} ]] ; then
-            echo ${index_message};
-            fi
-        fi
-    fi
-
-done
-if [[ $COUNT > 0 ]]; then
-     >&2 echo "Found $COUNT rst files with errors, check full log for details.";
-     exit 1;
-   else
-     exit 0;
-fi
diff --git a/typo3/sysext/core/Build/Scripts/xlfcheck.sh b/typo3/sysext/core/Build/Scripts/xlfcheck.sh
deleted file mode 100755 (executable)
index 00c60a7..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/bash
-
-#########################
-#
-# Find all xmlns:t3 namespace definition and
-# t3:id numbers in XLF language files
-# and check their uniqueness.
-#
-# It expects to be run from the core root.
-#
-##########################
-
-XLF_FILES="xlffiles.txt"
-XLF_IDS="xlfids.txt"
-XLF_XMLNS="xlfxmlns.txt"
-
-function join { local IFS="$1"; shift; echo "$*"; }
-
-echo 'Collecting XLF files'
-find typo3/ -name '*.xlf' > $XLF_FILES
-XLFCNT=$(cat xlffiles.txt | wc -l)
-
-# Check for xmlns
-echo 'Extracting xmlns:t3 information'
-sed -ne 's/.*\(xmlns:t3="http:\/\/typo3.org\/schemas\/xliff"\)/\1/pg' `cat $XLF_FILES` | sort > $XLF_XMLNS
-XLFXMLNSCNT=$(cat $XLF_XMLNS | wc -l)
-DIFFXMLNS=$(join , $(uniq -d $XLF_XMLNS))
-MISSINGXMLNS=$(join , $(grep -L 'xmlns:t3="http://typo3.org/schemas/xliff"' `cat $XLF_FILES`))
-
-# Checks for t3:id
-echo 'Extracting t3:id information'
-sed -ne 's/.*t3:id="\([0-9]\+\)".*/\1/pg' `cat $XLF_FILES` | sort > $XLF_IDS
-
-echo 'Processing ids'
-XLFIDCNT=$(cat $XLF_IDS | wc -l)
-UXLFIDCNT=$(uniq $XLF_IDS | wc -l)
-DIFFIDS=$(join , $(uniq -d $XLF_IDS))
-MISSINGIDS=$(join , $(grep -L 't3:id' `cat $XLF_FILES`))
-
-# Cleanup of temporary files
-rm $XLF_IDS $XLF_FILES $XLF_XMLNS
-
-if [ $XLFCNT -ne $XLFXMLNSCNT ];
-then
-       echo "There is at least one XLF file missing a xmlns for t3 (xmlns:t3)."
-       echo "Missing in: $MISSINGXMLNS"
-       exit 1
-fi
-
-if [ $XLFCNT -ne $XLFIDCNT ];
-then
-       echo "There is at least one XLF file missing a unique ID (t3:id)."
-       echo "Missing in: $MISSINGIDS"
-       exit 1
-fi
-if [ $XLFIDCNT -ne $UXLFIDCNT ];
-then
-       echo "There is an XLF id that does not seem to be UNIQUE."
-       echo "Search for t3:id $DIFFIDS"
-       exit 1
-fi
-
-exit 0