CI: check translations against detached branches

To avoid git complaining about duplicate worktrees, detach
the temporary trees. To avoid python modules translations
changing order (depending on how find traverses the tree),
sort the filenames before extraction.

(cherry picked from commit c3f366ce9e)
This commit is contained in:
Adriaan de Groot 2022-08-23 11:48:14 +02:00
parent ca94ca4594
commit 733e4d64e1
2 changed files with 3 additions and 3 deletions

View File

@ -120,7 +120,7 @@ tx_sum()
WORKTREE_NAME="$1"
WORKTREE_TAG="$2"
git worktree add $WORKTREE_NAME $WORKTREE_TAG > /dev/null 2>&1 || { echo "! Could not create worktree." ; exit 1 ; }
git worktree add -d $WORKTREE_NAME $WORKTREE_TAG > /dev/null 2>&1 || { echo "! Could not create worktree." ; exit 1 ; }
( 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

View File

@ -124,8 +124,8 @@ tx push --source --no-interactive -r calamares.fdo
PYGETTEXT="xgettext --keyword=_n:1,2 -L python"
SHARED_PYTHON=""
for MODULE_DIR in $(find src/modules -maxdepth 1 -mindepth 1 -type d) ; do
FILES=$(find "$MODULE_DIR" -name "*.py" -a -type f)
for MODULE_DIR in $(find src/modules -maxdepth 1 -mindepth 1 -type d | sort) ; do
FILES=$(find "$MODULE_DIR" -name "*.py" -a -type f | sort)
if test -n "$FILES" ; then
MODULE_NAME=$(basename ${MODULE_DIR})
if [ -d ${MODULE_DIR}/lang ]; then