[sysadmin/l10n-scripty] /: git add (aka delete) if they existed before and don't exist now
Albert Astals Cid <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit d66f759386b395c07e9efc3be026cbd512a6b347 by Albert Astals Cid.
Committed on 20/07/2026 at 15:19.
Pushed by aacid into branch 'master'.
git add (aka delete) if they existed before and don't exist now
M +6 -2 update_translations
https://invent.kde.org/sysadmin/l10n-scripty/-/commit/d66f759386b395c07e9efc3be026cbd512a6b347
diff --git a/update_translations b/update_translations
index b4b53875..b18a09a4 100755
--- a/update_translations
+++ b/update_translations
@@ -638,13 +638,17 @@ update_translations() {
cd $BASEDIR/`get_path $repo`
# We remove everything and then add things again
# git is happy doing the adds/removes/nothing changed by itself
+ poqm_existed=false
+ po_existed=false
+ [ -d "poqm" ] && poqm_existed=true
+ [ -d "po" ] && po_existed=true
rm -rf $BASEDIR/`get_path $repo`/poqm
rm -rf $BASEDIR/`get_path $repo`/po
copyGUITranslations $BASEDIR/`get_path $repo` $BASEDIR/$transmod $repo $BASEDIR/$transmod/subdirs
copyDOCTranslations $BASEDIR/`get_path $repo` $BASEDIR/$transmod $repo $BASEDIR/$transmod/subdirs
copyScriptsFiles $BASEDIR/`get_path $repo` $BASEDIR/$transmod $repo $BASEDIR/$transmod/subdirs
- [ -d "po" ] && (chronic git add po || pwd)
- [ -d "poqm" ] && (chronic git add poqm || pwd)
+ { [ "$po_existed" = true ] || [ -d "po" ]; } && (chronic git add po || pwd)
+ { [ "$poqm_existed" = true ] || [ -d "poqm" ]; } && (chronic git add poqm || pwd)
status=`git status -s`
if [ "x$status" != "x" ]; then
branch=`get_branch $repo`