From 8eca883955837b486f5b28060aa527ffb90cdd29 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Tue, 28 Dec 2004 07:40:46 +0000 Subject: [PATCH] 1st revision of a tree-splitting script for PDA packaging --- utils/splittree | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 utils/splittree diff --git a/utils/splittree b/utils/splittree new file mode 100755 index 00000000000..944a6eb42c7 --- /dev/null +++ b/utils/splittree @@ -0,0 +1,38 @@ +#!/bin/sh +set -e + +[ $# = 2 ] || { echo >&2 "$0: wrong number of arguments"; exit 1; } + +src=$1 +dst=$2 + +dirs_= +dirs_music=music +dirs_sound=sounds +dirs_httt='Heir_To_The_Throne*' +dirs_ei='Eastern_Invasion*' +dirs_sotbe='Son_Of_The_Black_Eye*' +dirs_tdh='The_Dark_Hordes*' +dirs_trow='The_Rise_of_Wesnoth*' +dirs_devel='tools wmlxgettext' +dirs_editor='editor*' +dirs_tutorial='tutorial Tutorial' +dirs_mp=multiplayer +dirs_locales=translations +dirs_junk='scenario-test.cfg convert.pl README man' + +for p in music sound httt ei sotbe tdh trow devel editor tutorial mp locales junk +do + rm -rf $dst/wesnoth-$p + eval dirs=\${dirs_$p} + findexpr=-false + for d in $dirs + do + findexpr="$findexpr -o -name $d" + done + for d in $(cd $src && find $findexpr) + do + mkdir -p $dst/wesnoth-$p/$(dirname $d) + mv $src/$d $dst/wesnoth-$p/$(dirname $d) + done +done