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.
tde-common-other/release/removestuff

119 lines
3.3 KiB

# 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 = "tde-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 = "tde-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*.*
)