scripts: fetch-lineage-translations: Skip duplicate strings
* dt2s strings exist in both Settings and LineageParts (leftover)
Change-Id: Ifa2d4363c2fcc6daa78b2eede5e1a2b319eeba82
diff --git a/lineage-merger/fetch-lineage-translations.sh b/lineage-merger/fetch-lineage-translations.sh
index 24f5d87..657517d 100755
--- a/lineage-merger/fetch-lineage-translations.sh
+++ b/lineage-merger/fetch-lineage-translations.sh
@@ -129,8 +129,14 @@
for STRING in $STRINGS_TO_FIND; do
LINE=$(GIT_PAGER="cat" git show "$REF":"$TRANSLATION" | grep -Pzo " <(string|plurals) name=\"$STRING\">[\s\S]*?</(string|plurals)>" | sed 's/\x0$/\n/g')
+ EXISTING_LINE=$(grep -Pzo " <(string|plurals) name=\"$STRING\">[\s\S]*?</(string|plurals)>" "$FILENAME" | sed 's/\x0$/\n/g')
if [ ! -z "$LINE" ]; then
+ if [ ! -z "$EXISTING_LINE" ]; then
+ echo "WARNING: Skipping duplicate string $STRING"
+ continue;
+ fi
+
echo "$LINE" >> "$FILENAME"
fi
done