2
# links resources from one directory to another and sorts them there
3
# usage: resources <source> <destination> <path to sortresources.py>
12
#test -z `echo ${sortresources} | grep "^/"` && sortresources=`pwd`/${sortresources}
14
# exit if source does not exist
15
test -d $source || exit 0
17
# remake directory for included resources
21
# link/softlink/copy them over
22
cp -Rlf ${source}/* ${destination}/ > /dev/null 2>&1 || cp -Rsf ${source}/* ${destination}/ > /dev/null 2>&1 || cp -Rf ${source}/* ${destination}/ || { echo Copying or linking resources failed. ; exit 1;}
24
# remove CVS directories and backup files
25
find ${destination}/ -depth -type d -name CVS -exec rm -rf \{\} \;
26
find ${destination}/ -depth -type d -name .svn -exec rm -rf \{\} \;
27
find ${destination}/ -name "*~" -exec rm -rf \{\} \;
29
# rename them properly
30
python ${sortresources} -v ${destination} || exit 1
32
# silently remove empty directories
33
find ${destination} -type d -depth -exec rmdir \{\} \; > /dev/null 2>&1
35
# copy map dtd file to one with correct version
36
MAPVERSION=`grep "<!-- version=" < ${destination}/map.dtd | sed -e "s,.*=\",," -e "s,\".*,,"`
37
test -r ${destination}/AATeam || mkdir ${destination}/AATeam
38
cp ${destination}/map.dtd ${destination}/AATeam/map-$MAPVERSION.dtd
39
echo $MAPVERSION > ${destination}/.mapversion
42
touch ${destination} || exit 1
43
chmod 755 ${destination} || exit 1