From 1883def34c64990d6ce52d055d694b6050b70ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Mon, 16 Mar 2009 22:12:24 +0200 Subject: [PATCH] Initial version of checkout script. --- checkout | 200 ++++++++++++++++++++++++++++++++++++++++++++++++++ ths-variables | 7 +- 2 files changed, 205 insertions(+), 2 deletions(-) create mode 100755 checkout diff --git a/checkout b/checkout new file mode 100755 index 0000000..6a5f068 --- /dev/null +++ b/checkout @@ -0,0 +1,200 @@ +#!/bin/bash +# Copyright (C) 2009 Andrius Štikonas +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +source `dirname $0`/ths-variables + +if [ ! -f $THS ]; then + echo "Please enter your language code (Default: lt):" + read lcode + if [ ! "$lcode" ]; then + lcode="lt" + fi + echo lcode="$lcode" >> $THS + + echo "Enter path for stable templates (Default: `pwd`/pot-stable/):" + read potstable + if [ ! "$potstable" ]; then + potstable="pot-stable/" + fi + echo potstable="$potstable" >> $THS + + echo "Enter path for trunk templates (Default: `pwd`/pot-trunk/):" + read pottrunk + if [ ! "$pottrunk" ]; then + pottrunk="pot-trunk/" + fi + echo pottrunk="$pottrunk" >> $THS + + echo "Enter path for stable messages (Default: `pwd`/stable/):" + read postable + if [ ! "$postable" ]; then + postable="stable/" + fi + echo postable="$postable" >> $THS + + echo "Enter path for trunk messages (Default: `pwd`/pot-trunk/):" + read potrunk + if [ ! "$potrunk" ]; then + potrunk="trunk/" + fi + echo potrunk="$potrunk" >> $THS + + while [ ! "$documentation" = "n" ] && [ ! "$documentation" = "y" ]; do + echo "Do you want to checkout documentation messages and templates? [y/N]" + read documentation + documentation=`echo $documentation | tr YN yn` + if [ ! $documentation ]; then + documentation="n" + fi + done + echo documentation="$documentation" >> $THS + + if [ "$documentation" = "y" ]; then + echo "Enter path for documentation stable templates (Default: `pwd`/doc-pot-stable/):" + read docpotstable + if [ ! "$docpotstable" ]; then + docpotstable="doc-pot-stable/" + fi + echo docpotstable="$docpotstable" >> $THS + + echo "Enter path for documentation trunk templates (Default: `pwd`/doc-pot-trunk/):" + read docpottrunk + if [ ! "$docpottrunk" ]; then + docpottrunk="doc-pot-trunk/" + fi + echo docpottrunk="$docpottrunk" >> $THS + + echo "Enter path for documentation stable messages (Default: `pwd`/doc-stable/):" + read docstable + if [ ! "$docstable" ]; then + docstable="doc-stable/" + fi + echo docstable="$docstable" >> $THS + + echo "Enter path for documentation trunk messages (Default: `pwd`/doc-trunk/):" + read doctrunk + if [ ! "$doctrunk" ]; then + doctrunk="doc-trunk/" + fi + echo doctrunk="$doctrunk" >> $THS + fi + + echo "Enter enter workspace prefix (Default: workspace):" + read workspace + if [ ! "$workspace" ]; then + workspace="workspace" + fi + echo workspace="$workspace" >> $THS + + while [ ! "$svnwrite" = "n" ] && [ ! "$svnwrite" = "y" ]; do + echo "Do you have write access to KDE svn repository? [y/N]" + read svnwrite + svnwrite=`echo $svnwrite | tr YN yn` + if [ ! $svnwrite ]; then + svnwrite="n" + fi + done + echo svnwrite="$svnwrite" >> $THS + + if [ "$svnwrite" = "y" ]; then + while [ "$username" ]; do + echo "Please enter your username for KDE svn repository:" + read username + done + echo username="$username" >> $THS + fi + + # Checkout repositories. + if [ "$svnwrite" = "y" ]; then + svn co svn+ssh://$username@svn.kde.org/home/kde/branches/stable/l10n-kde4/templates/messages $potstable + else + svn co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/templates/messages $potstable + fi + + if [ "$svnwrite" = "y" ]; then + svn co svn+ssh://$username@svn.kde.org/home/kde/trunk/l10n-kde4/templates/messages $pottrunk + else + svn co svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/templates/messages $pottrunk + fi + + if [ "$svnwrite" = "y" ]; then + svn co svn+ssh://$username@svn.kde.org/home/kde/branches/stable/l10n-kde4/$lcode/messages $postable + else + svn co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/$lcode/messages $postable + fi + + if [ "$svnwrite" = "y" ]; then + svn co svn+ssh://$username@svn.kde.org/home/kde/trunk/l10n-kde4/$lcode/messages $potrunk + else + svn co svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/$lcode/messages $potrunk + fi + + if [ "$documentation" = "y" ]; then + if [ "$svnwrite" = "y" ]; then + svn co svn+ssh://$username@svn.kde.org/home/kde/branches/stable/l10n-kde4/templates/docmessages $docpotstable + else + svn co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/templates/docmessages $docpotstable + fi + + if [ "$svnwrite" = "y" ]; then + svn co svn+ssh://$username@svn.kde.org/home/kde/trunk/l10n-kde4/templates/docmessages $docpottrunk + else + svn co svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/templates/docmessages $docpottrunk + fi + + if [ "$svnwrite" = "y" ]; then + svn co svn+ssh://$username@svn.kde.org/home/kde/branches/stable/l10n-kde4/$lcode/docmessages $docstable + else + svn co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/$lcode/docmessages $docstable + fi + + if [ "$svnwrite" = "y" ]; then + svn co svn+ssh://$username@svn.kde.org/home/kde/trunk/l10n-kde4/$lcode/docmessages $doctrunk + else + svn co svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/$lcode/docmessages $doctrunk + fi + fi + +else + source $THS + wdir=`pwd` + cd $potstable + svn up + cd $wdir + cd $pottrunk + svn up + cd $wdir + cd $postable + svn up + cd $wdir + cd $potrunk + svn up + cd $wdir + if [ "$documentation" = "y" ]; then + cd $docpotstable + svn up + cd $wdir + cd $docpottrunk + svn up + cd $wdir + cd $docpostable + svn up + cd $wdir + cd $docpotrunk + svn up + cd $wdir + fi +fi diff --git a/ths-variables b/ths-variables index 60e012d..7e91d99 100644 --- a/ths-variables +++ b/ths-variables @@ -15,7 +15,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -#Binaries +# Settings file +THS=".ths" + +# Binaries DIFF=`which diff 2> /dev/null` MSGATTRIB=`which msgattrib 2> /dev/null` MSGFILTER=`which msgfilter 2> /dev/null` @@ -24,7 +27,7 @@ MSGINIT=`which msginit 2> /dev/null` MSGMERGE=`which msgmerge 2> /dev/null` KDIFF3=`which kdiff3 2> /dev/null` -#Colors +# Colors RED="\033[0;31m" GREEN="\033[0;32m" BLUE="\033[0;34m"