summaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorAdriaan de Groot <groot@kde.org>2020-01-25 17:31:55 +0100
committerAdriaan de Groot <groot@kde.org>2020-01-25 17:34:44 +0100
commitfa466b447cb7e52d815247277d4ce57e7305e82b (patch)
tree60427dde78403547e2a3e93839f9156aa63cd4b8 /ci
parent64b56664de8fd8af64225b67cd272e759e12d8d2 (diff)
CI: Canonicalize XML first
- Do XML processing / canonicalisation in txpush only - Run the *HEAD* version of txpush in both worktrees
Diffstat (limited to 'ci')
-rw-r--r--ci/txcheck.sh14
-rwxr-xr-xci/txpush.sh2
2 files changed, 6 insertions, 10 deletions
diff --git a/ci/txcheck.sh b/ci/txcheck.sh
index 7f85be970..73092adea 100644
--- a/ci/txcheck.sh
+++ b/ci/txcheck.sh
@@ -71,19 +71,15 @@ done
# The state of translations
tx_sum()
{
+ CURDIR=`pwd`
WORKTREE_NAME="$1"
WORKTREE_TAG="$2"
git worktree add $WORKTREE_NAME $WORKTREE_TAG > /dev/null 2>&1 || { echo "! Could not create worktree." ; exit 1 ; }
- ( cd $WORKTREE_NAME && sh ci/txpush.sh --no-tx ) > /dev/null 2>&1 || { echo "! Could not re-create translations." ; exit 1 ; }
- # Clean up the TS (XML) files (like txpush would)
- TS_FILE="$WORKTREE_NAME/lang/calamares_en.ts"
- if test -n "$XMLLINT" ; then
- $XMLLINT --format --encode utf-8 -o "$TS_FILE".new "$TS_FILE" && mv "$TS_FILE".new "$TS_FILE"
- fi
- sed -i'' -e '/<location filename/d' $TS_FILE
-
- # Remove linenumbers from .pot
+ ( cd $WORKTREE_NAME && sh "$CURDIR"/ci/txpush.sh --no-tx ) > /dev/null 2>&1 || { echo "! Could not re-create translations." ; exit 1 ; }
+
+ # Remove linenumbers from .ts (XML) and .pot
+ sed -i'' -e '/<location filename/d' "$WORKTREE_NAME/lang/calamares_en.ts"
sed -i'' -e '/^#: src..*[0-9]$/d' $WORKTREE_NAME/lang/python.pot $WORKTREE_NAME/src/modules/dummypythonqt/lang/dummypythonqt.pot
_SUM=$( cd $WORKTREE_NAME && cat $TX_FILE_LIST | sha256sum )
diff --git a/ci/txpush.sh b/ci/txpush.sh
index 6f3c8db17..c913cbb96 100755
--- a/ci/txpush.sh
+++ b/ci/txpush.sh
@@ -83,7 +83,7 @@ $LUPDATE -no-obsolete $_srcdirs -ts lang/calamares_en.ts
if test -n "$XMLLINT" ; then
TS_FILE="lang/calamares_en.ts"
- $XMLLINT --format --encode utf-8 -o "$TS_FILE".new "$TS_FILE" && mv "$TS_FILE".new "$TS_FILE"
+ $XMLLINT --c14n11 "$TS_FILE" | $XMLLINT --format --encode utf-8 -o "$TS_FILE".new - && mv "$TS_FILE".new "$TS_FILE"
fi
tx push --source --no-interactive -r calamares.calamares-master