summaryrefslogtreecommitdiffstats
path: root/release/removestuff
blob: 96e593bbd53710ed1d4a27264e66c3ed38983759 (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
109
110
111
112
113
114
115
116
117
118
# This is a helper script, which removes the useless stuff from some modules.
# For instance it separates the koffice translations between kde-l10n and koffice-l10n.
# Call it with the package name as argument, like:  ./removestuff kde-l10n

# This is called by tag_all with DO_SVN=1 in order to remove unused stuff from a tag.

source `dirname $0`/common $1 $2

rm_command="rm -rf"
if test -n "$DO_SVN"; then
  rm_command="svn rm"
fi

cd_package()
{
  if test -n "$version" && test -d $package-$version; then
    cd $package-$version
  else
    cd $package || { echo "bah! $package doesn't exist in $PWD"; exit 1; }
  fi
}

  if [ $package = "koffice-l10n" ]; then
  (
     cd_package
     echo "Removing non-koffice stuff"
     $rm_command templates
     if grep -E -q '[a-z] +$' subdirs; then
       echo "subdirs has a trailing space on a line! This breaks stuff, fix it."
       exit 1
     fi
     cat subdirs | while read lang; do
       cd $lang || continue
       echo $lang
       $rm_command internal
       $rm_command docmessages
       $rm_command webmessages
       $rm_command */messages/koffice/kdgantt.po
       for sub in messages docs data; do
         test -d $sub || continue
         cd $sub
         for i in *; do
           test $i != "koffice" -a $i != "Makefile.am" && $rm_command $i
         done
         cd ..
         files=`ls -1 $sub | wc -l`
         test $files -eq 0 && $rm_command $sub
       done
       cd ..
     done
     echo "Removing template specific stuff"
     $rm_command templates
     echo "Removing documentation links"
     $rm_command documentation
     $rm_command debian
  ) || exit 1
  fi

  if [ $package = "kde-l10n" -o $package = "kde-i18n" ]; then
  (
     cd_package
     echo "Removing other stuff"
     cat subdirs | while read lang; do
       cd $lang || continue
       $rm_command internal 
       $rm_command docmessages 
       $rm_command webmessages 
       $rm_command messages/*/desktop_* 
       $rm_command messages/others 
       $rm_command docs/others 
       $rm_command messages/kdenonbeta 
       $rm_command docs/kdenonbeta 
       $rm_command messages/extragear-* 
       $rm_command docs/extragear-* 
       $rm_command messages/kdekiosk
       $rm_command docs/kdekiosk 
       $rm_command messages/play* 
       $rm_command messages/kdereview 
       $rm_command docs/kdereview
       $rm_command docs/play*
       $rm_command */koffice 
       test -d docs/common || {
            echo "$lang/docs/common not translated, removing" 
            $rm_command docs 
       }
       cd ..
     done
     echo "Removing template specific stuff"
     $rm_command templates
     echo "Removing documentation links"
     $rm_command documentation
  )
  fi

  if [ $package = "kde-l10n" -o $package = "koffice-l10n" -o $package = "kde-i18n" ]; then
  (
    cd_package
    echo Removing non-released languages from package
    grep ^xx subdirs && { echo "$package/subdirs contains the xx language!"; exit 1; }
    for dir in *; do
	if test -d $dir/messages -o -d $dir/docs; then
            if grep -q ^$dir\$ subdirs; then
                 echo Keeping $dir
            else
                 echo Deleting $dir
                 $rm_command $dir
	    fi
        fi
    done
    ) || exit 1
  fi

  # generic stuff
  (
     cd_package
     rm -f svn-commit*.*
  )