Skip to content

Instantly share code, notes, and snippets.

@minorua
Last active August 29, 2015 14:02
Show Gist options
  • Save minorua/83992a38c47ee9d502e4 to your computer and use it in GitHub Desktop.
Save minorua/83992a38c47ee9d502e4 to your computer and use it in GitHub Desktop.
[qgis-jp][GUI翻訳] translationブランチの更新スクリプト
#!/bin/bash
# qgis-jpのtranslatioinブランチにmasterの更新を取り入れ、qgis_ja.tsを更新するスクリプト
# begin : 2013-05-09
# remote repositories
# upstream: https://github.com/qgis/QGIS.git
# qgis-jp: git@github.com:qgis-jp/QGIS.git
updatediff=~/updates.diff
cd ~/dev/cpp/QGIS
git reset HEAD --hard
# update local branches
git checkout master
git pull upstream master
git checkout translation
git pull qgis-jp translation
git merge master
# ckeck merge conflict
if [ $? -ne 0 ]; then
echo "error occured while merging"
echo "continue to auto-fix? [y/n]..."
read ans
if [ $ans != "y" ]; then
exit 1
fi
echo "auto-fixixing conflict: take qgis_ja.ts in translation"
git checkout ORIG_HEAD i18n/qgis_ja.ts
git commit
fi
# execute cmake to update *texts.cpp files
cd build-master
cmake ..
cd ..
# update .ts files
./scripts/update_ts_files.sh
# get revision of latest commit
rev=`git log --oneline -n 1 | cut -d " " -f 1`
# do commit
git add i18n/qgis_ja.ts
git commit -m "update qgis_ja.ts (using update_ts_files.sh, ${rev})"
git show HEAD > ${updatediff}
echo "diff outputted: ${updatediff}"
# do push
git log --oneline -n 5
echo "ready... checked diff? let's push"
echo "git push qgis-jp master translation"
#git push qgis-jp master translation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment