ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cf.schmorp.de/util/copy_names
Revision: 1.1
Committed: Tue Nov 3 19:23:11 2009 UTC (14 years, 7 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Log Message:
*** empty log message ***

File Contents

# Content
1 #!/bin/sh
2
3 # quick hack to copy map names from crossire to deliantra maps
4
5 SRC=/root/cvs/crossfire/maps
6 DST=/root/src/deliantra/maps
7
8 cd "$SRC" || exit 1
9
10 find . -name .svn -prune -o -type f -print | while read map; do
11 [ -f "$DST"/"$map.map" ] || continue
12 [ "$(head -1 "$map" 2>/dev/null)" = "arch map" ] || continue
13 name=$(< "$map" head -2 | tail -1)
14 case "$name" in "name "* ) ;; * ) continue ;; esac
15 case "$name" in "name world"* ) continue ;; esac
16
17 (
18 <"$DST/$map.map" head -4 | grep -v "^name "
19 echo $name
20 <"$DST/$map.map" tail -n+4
21 ) >"$DST/$map.map~"
22
23 if cmp -s "$DST/$map.map~" "$DST/$map.map"; then
24 rm "$DST/$map.map~"
25 else
26 echo $map $name
27 mv "$DST/$map.map~" "$DST/$map.map"
28 cfmap-normalize "$DST/$map.map"
29 fi
30 done