Translation helper scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

194 lines
5.6KB

  1. #!/bin/bash
  2. # Copyright (C) 2009 Andrius Štikonas <stikonas@gmail.com>
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 2 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. source `dirname $0`/ths-variables
  17. if [ ! -f $THS ]; then
  18. echo "Please enter your language code (Default: lt):"
  19. read lcode
  20. if [ ! "$lcode" ]; then
  21. lcode="lt"
  22. fi
  23. echo lcode="$lcode" >> $THS
  24. echo "Enter path for stable templates (Default: `pwd`/pot-stable/):"
  25. read potstable
  26. if [ ! "$potstable" ]; then
  27. potstable="pot-stable/"
  28. fi
  29. echo potstable="$potstable" >> $THS
  30. echo "Enter path for trunk templates (Default: `pwd`/pot-trunk/):"
  31. read pottrunk
  32. if [ ! "$pottrunk" ]; then
  33. pottrunk="pot-trunk/"
  34. fi
  35. echo pottrunk="$pottrunk" >> $THS
  36. echo "Enter path for stable messages (Default: `pwd`/stable/):"
  37. read postable
  38. if [ ! "$postable" ]; then
  39. postable="stable/"
  40. fi
  41. echo postable="$postable" >> $THS
  42. echo "Enter path for trunk messages (Default: `pwd`/pot-trunk/):"
  43. read potrunk
  44. if [ ! "$potrunk" ]; then
  45. potrunk="trunk/"
  46. fi
  47. echo potrunk="$potrunk" >> $THS
  48. while [ ! "$documentation" = "n" ] && [ ! "$documentation" = "y" ]; do
  49. echo "Do you want to checkout documentation messages and templates? [y/N]"
  50. read documentation
  51. documentation=`echo $documentation | tr YN yn`
  52. if [ ! $documentation ]; then
  53. documentation="n"
  54. fi
  55. done
  56. echo documentation="$documentation" >> $THS
  57. if [ "$documentation" = "y" ]; then
  58. echo "Enter path for documentation stable templates (Default: `pwd`/doc-pot-stable/):"
  59. read docpotstable
  60. if [ ! "$docpotstable" ]; then
  61. docpotstable="doc-pot-stable/"
  62. fi
  63. echo docpotstable="$docpotstable" >> $THS
  64. echo "Enter path for documentation trunk templates (Default: `pwd`/doc-pot-trunk/):"
  65. read docpottrunk
  66. if [ ! "$docpottrunk" ]; then
  67. docpottrunk="doc-pot-trunk/"
  68. fi
  69. echo docpottrunk="$docpottrunk" >> $THS
  70. echo "Enter path for documentation stable messages (Default: `pwd`/doc-stable/):"
  71. read docstable
  72. if [ ! "$docstable" ]; then
  73. docstable="doc-stable/"
  74. fi
  75. echo docstable="$docstable" >> $THS
  76. echo "Enter path for documentation trunk messages (Default: `pwd`/doc-trunk/):"
  77. read doctrunk
  78. if [ ! "$doctrunk" ]; then
  79. doctrunk="doc-trunk/"
  80. fi
  81. echo doctrunk="$doctrunk" >> $THS
  82. fi
  83. while [ ! "$svnwrite" = "n" ] && [ ! "$svnwrite" = "y" ]; do
  84. echo "Do you have write access to KDE svn repository? [y/N]"
  85. read svnwrite
  86. svnwrite=`echo $svnwrite | tr YN yn`
  87. if [ ! $svnwrite ]; then
  88. svnwrite="n"
  89. fi
  90. done
  91. echo svnwrite="$svnwrite" >> $THS
  92. if [ "$svnwrite" = "y" ]; then
  93. while [ ! "$username" ]; do
  94. echo "Please enter your username for KDE svn repository:"
  95. read username
  96. done
  97. echo username="$username" >> $THS
  98. fi
  99. # Checkout repositories.
  100. if [ "$svnwrite" = "y" ]; then
  101. svn co svn+ssh://$username@svn.kde.org/home/kde/branches/stable/l10n-kde4/templates/messages $potstable
  102. else
  103. svn co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/templates/messages $potstable
  104. fi
  105. if [ "$svnwrite" = "y" ]; then
  106. svn co svn+ssh://$username@svn.kde.org/home/kde/trunk/l10n-kde4/templates/messages $pottrunk
  107. else
  108. svn co svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/templates/messages $pottrunk
  109. fi
  110. if [ "$svnwrite" = "y" ]; then
  111. svn co svn+ssh://$username@svn.kde.org/home/kde/branches/stable/l10n-kde4/$lcode/messages $postable
  112. else
  113. svn co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/$lcode/messages $postable
  114. fi
  115. if [ "$svnwrite" = "y" ]; then
  116. svn co svn+ssh://$username@svn.kde.org/home/kde/trunk/l10n-kde4/$lcode/messages $potrunk
  117. else
  118. svn co svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/$lcode/messages $potrunk
  119. fi
  120. if [ "$documentation" = "y" ]; then
  121. if [ "$svnwrite" = "y" ]; then
  122. svn co svn+ssh://$username@svn.kde.org/home/kde/branches/stable/l10n-kde4/templates/docmessages $docpotstable
  123. else
  124. svn co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/templates/docmessages $docpotstable
  125. fi
  126. if [ "$svnwrite" = "y" ]; then
  127. svn co svn+ssh://$username@svn.kde.org/home/kde/trunk/l10n-kde4/templates/docmessages $docpottrunk
  128. else
  129. svn co svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/templates/docmessages $docpottrunk
  130. fi
  131. if [ "$svnwrite" = "y" ]; then
  132. svn co svn+ssh://$username@svn.kde.org/home/kde/branches/stable/l10n-kde4/$lcode/docmessages $docstable
  133. else
  134. svn co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/$lcode/docmessages $docstable
  135. fi
  136. if [ "$svnwrite" = "y" ]; then
  137. svn co svn+ssh://$username@svn.kde.org/home/kde/trunk/l10n-kde4/$lcode/docmessages $doctrunk
  138. else
  139. svn co svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/$lcode/docmessages $doctrunk
  140. fi
  141. fi
  142. else
  143. source $THS
  144. wdir=`pwd`
  145. cd $potstable
  146. svn up
  147. cd $wdir
  148. cd $pottrunk
  149. svn up
  150. cd $wdir
  151. cd $postable
  152. svn up
  153. cd $wdir
  154. cd $potrunk
  155. svn up
  156. cd $wdir
  157. if [ "$documentation" = "y" ]; then
  158. cd $docpotstable
  159. svn up
  160. cd $wdir
  161. cd $docpottrunk
  162. svn up
  163. cd $wdir
  164. cd $docstable
  165. svn up
  166. cd $wdir
  167. cd $doctrunk
  168. svn up
  169. cd $wdir
  170. fi
  171. fi