]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - tools/git-tp-sync
3 # git-tp-sync - downloads the latest PO files from translationproject.org
4 # and commits changes to your GIT repository.
7 # - commit per PO file (no more huge commits for all .po files)
8 # - the commit "Author:" field is set according to the Last-Translator
10 # Copyright (C) 2007-2016 Karel Zak <kzak@redhat.com>
12 # This file is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
15 # (at your option) any later version.
17 # This file is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
27 rsync
-Lrtvz rsync
://translationproject.org
/tp
/latest
/$PROJECT/$1.po po
32 rsync
-Lrtvz rsync
://translationproject.org
/tp
/latest
/$PROJECT/ po
35 PO_NEW
=$
(git ls-files
-o | gawk
'/po\/[[:alpha:]_\-]*\.po/ { sub("po/", ""); print $0; }' |
sort)
36 PO_MOD
=$
(git ls-files
-m | gawk
'/po\/[[:alpha:]_\-]*\.po/ { sub("po/", ""); print $0; }' |
sort)
39 echo $
(gawk
'BEGIN { FS=": " } /Last-Translator/ { sub("\\\\n\"", ""); print $2 }' "$1")
45 local AUTHOR
=$
(get_author
"$POFILE")
47 git commit
--author "$AUTHOR" -m "$MSG" "$POFILE"
51 do_commit
"po/$f" "po: update $f (from translationproject.org)"
56 do_commit
"po/$f" "po: add $f (from translationproject.org)"