summaryrefslogtreecommitdiffstats
path: root/release/tag_all
blob: 98bf3760edac47a04fcc4759646f4400bc2d42ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/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/"