#!/bin/bash # This script tags all modules listed in the "modules" file. # # Make sure to fix the set_urls function so that it uses the right tags. # language_list becomes the subdirs file in the l10n module, make sure it's uptodate. # Once it's all done, the script checks out the tagged directories under clean/. #SVNUSER=coolo #SVNPROTOCOL=svn+ssh test -n "$SVNUSER" || { echo "You must set SVNUSER"; exit 1; } test -n "$SVNPROTOCOL" || { echo "You must set SVNPROTOCOL"; exit 1; } BASE=$SVNPROTOCOL://$SVNUSER@svn.kde.org/home/kde # Temporary checkout directory tagdir=tagging.$$ function co_subdir { echo co_subdir $1 if test ! -d $tagdir/$1; then co_subdir `dirname $1` svn up -N $tagdir/$1 fi } . versions function replace_exts { svn pg svn:externals $1 | while read subdir url; do test -n "$url" || continue rm -rf $1/$subdir svn copy ${url/https:\/\//$SVNPROTOCOL://$SVNUSER@} $1/$subdir done svn pd svn:externals $1 } if test -z "$ONLY_CLEANUP"; then svn co -N $BASE $tagdir co_subdir tags fi l10n_module="" for i in `cat modules`; do test -z "$ONLY_CLEANUP" || continue isl10n=0 case $i in *-l10n|*-i18n) isl10n=1 l10n_module=$i ;; esac set_urls $i co_subdir `dirname $HEADURL` tt=`dirname $DESTURL` tt2=`dirname $tt` if ! test -d $tagdir/$tt; then svn up -N $tagdir/$tt2 svn up -N $tagdir/$tt if ! test -d $tagdir/$tt; then svn mkdir $tagdir/$tt fi fi svn up -N $tagdir/$HEADURL if test $isl10n -eq 1; then svn up -N $tagdir/$HEADURL/scripts fi if test -d $tagdir/$DESTURL; then echo "$tagdir/$DESTURL exists already" else svn copy $tagdir/$HEADURL $tagdir/$DESTURL fi replace_exts $tagdir/$DESTURL done if test -z "$ONLY_CLEANUP" -a -n "$l10n_module"; then set_urls $l10n_module cp language_list $tagdir/$DESTURL/subdirs replace_exts $tagdir/$DESTURL/scripts fi if test -z "$ONLY_CLEANUP"; then svn commit $tagdir || exit 1 rm -rf $tagdir fi cd clean for i in `cat ../modules`; do set_urls $i if test -d $subname; then svn cleanup $subname svn up --ignore-externals $subname # svn switch has problems with externals replaced with copies rm -rf $subname/admin $subname/scripts/admin $subname/libltdl svn cleanup $subname svn up --ignore-externals $subname svn switch $BASE/$DESTURL $subname else svn co $BASE/$DESTURL $subname fi DO_SVN=1 ../removestuff $subname done echo "All done, now commit from clean/"