Index: trunk/kde-common/makemessages =================================================================== --- trunk/kde-common/makemessages +++ trunk/kde-common/makemessages @@ -32,9 +32,11 @@ transmod_list="branches/stable/l10n-kde4 trunk/l10n-kf5 branches/stable/l10n-kf5 branches/stable/l10n-kf5-plasma-lts" for transmod in $transmod_list; do + transmod_key=`echo $transmod | sed -e "s,/,_,g"` + ologfile= if test -n "$1"; then - suffix=.`echo $transmod | sed -e "s,/,_,g"` + suffix=.$transmod_key dirname=`dirname "$1"` logfile=$1$suffix ologfile=$dirname/`cd $dirname && ls -1tr *$suffix | tail -n 1` @@ -42,26 +44,40 @@ logfile=/dev/stdout fi echo $transmod > $logfile - if svn update -q $transmod/scripts >>$logfile 2>&1; then - $transmod/scripts/update_translations >>$logfile 2>&1 - else - echo "ERROR: updating $transmod/scripts failed! Trying to recover..." >$logfile - if cd $transmod; then - # It seems that cleanup in the current directory works better (Why?) - svn cleanup >>$logfile 2>&1 - svn revert -q -R . >>$logfile 2>&1 - cd $BASEDIR - else - echo "ERROR: no $transmod directory?" >>$logfile - continue - fi - if svn update $transmod/scripts >>$logfile 2>&1; then - $transmod/scripts/update_translations >>$logfile 2>&1 - else - echo "!!!!!!!!!!!!! ERROR: $transmod/scripts cannot be updated!" >>$logfile - fi + + # Verify current Git branch + expected_scripts_branch=$transmod_key + if [ $transmod_key = "trunk_l10n-kf5" ]; then + expected_scripts_branch=master fi + expected_scripts_branch=$(echo $expected_scripts_branch | sed -e "s/branches_//g") + actual_scripts_branch=`cd scripts/$transmod_key && git rev-parse --abbrev-ref HEAD` + if [ "x$actual_scripts_branch" != "x$expected_scripts_branch" ]; then + echo "ERROR: repo scripts/$transmod_key is at wrong branch '$actual_scripts_branch', expected $expected_scripts_branch" >>$logfile + continue + fi + # Update scripts repository + if ! (cd scripts/$transmod_key && git pull --rebase $SVNQUIETFLAG >>$logfile 2>&1); then + echo "ERROR: possible conflict in scripts/$transmod_key" >>$logfile 2>&1 + continue + fi + + # Verify symlink + symlink_target_relative=$(readlink $transmod/scripts) + if [ "x$symlink_target_relative" = "x" ]; then + echo "ERROR: symlink $transmod/scripts does not exist" >>$logfile 2>&1 + continue + fi + actual_symlink_target=$(readlink -f $transmod/scripts) + expected_symlink_target=$(realpath -e scripts/$transmod_key) + if [ "x$actual_symlink_target" != "x$expected_symlink_target" ]; then + echo "ERROR: symlink $transmod/scripts points to unexpected path $actual_symlink_target, expected $expected_symlink_target" >>$logfile 2>&1 + continue + fi + + $transmod/scripts/update_translations >>$logfile 2>&1 + cd $transmod # As we do not check the documentation sub-directory and as anonsvn is not always reliable, do not try to update the externals. if svn update -q --ignore-externals >>$logfile 2>&1; then