ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cfmaps/cfupdate
(Generate patch)

Comparing cfmaps/cfupdate (file contents):
Revision 1.1 by root, Thu Nov 17 11:51:08 2005 UTC vs.
Revision 1.6 by root, Sun Nov 20 00:58:57 2005 UTC

1#!/bin/bash 1#!/bin/bash
2
3# cfupdate - convert a crossfire maps hierarchy to html
4# Copyright (C) 2005 Marc Lehmann <gvpe@schmorp.de>
5#
6# CFUPDATE is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with gvpe; if not, write to the Free Software
18# Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2 19
3umask 022 20umask 022
4 21
5PATH=/root/src/crossfire:$PATH 22PATH=/root/src/crossfire:$PATH
6BASE=/var/www/cfmaps.schmorp.de 23BASE=/var/www/cfmaps.schmorp.de
7export CROSSFIRE_LIBDIR=$BASE/lib 24export CROSSFIRE_LIBDIR=$BASE/lib
8 25
9cd "$BASE" || exit 69 26cd "$BASE" || exit 69
10 27
28VERSION=1.01
29
11cvs -Q -z3 update -AdP | grep -v ^\\? 30cvs -Q -z3 update -AdP | grep -v ^\\?
12
13chown -R root.root .
14chmod -R u=rwX,go=rX .
15 31
16rm -f .cfmap2html 32rm -f .cfmap2html
17 33
18find . -name CVS -prune -o -type d -printf "%P/\n" | while read dir; do 34find . -name CVS -prune -o -type d -printf "%P/\n" | while read dir; do
19 ( 35 (
20 export dir 36 export dir
21 cd "./$dir" || exit 68 37 cd "./$dir" || exit 68
22 { 38 {
23 echo "<html><head><title>$dir</title></head><body><ul>" >&7 39 echo "<html><head><title>Crossfire Maps Directory \"$dir\"</title></head><body><h1>Crossfire Maps Directory \"$dir\"</h1><ul>" >&7
24 echo "<li><a href='..'>&lt;parent&gt;</a></li>" >&7 40 echo "<li><a href='..'>&lt;parent&gt;</a></li></ul><h2>This Directory</h2><ul>" >&7
25 for file in *; do 41 for file in *; do
26 if [ -f "$file" ]; then 42 if [ -f "$file" ]; then
27 case "$file" in 43 case "$file" in
28 *.pst | *.jpg | *.png | *.html | *.html.gz | *~ ) 44 *.pst | *.jpg | *.png | *.html | *.html.gz | *~ )
29 ;; 45 ;;
45 echo "<li><a href='$file/'>$file/</a> [dir]</li>" >&7 61 echo "<li><a href='$file/'>$file/</a> [dir]</li>" >&7
46 ;; 62 ;;
47 esac 63 esac
48 fi 64 fi
49 done 65 done
66 echo "</ul>" >&7
67 cat <<EOF >&7
68<h2>Bookmarks</h2>
69<ul>
70 <li><a href="/world/">Worldmap</a></li>
71 <li><a href="/world/world_105_115.html">Scorn</a></li>
72 <li><a href="/world/world_102_108.html">Santo Dominion</a></li>
73 <li><a href="/world/world_107_123.html">Brest</a></li>
74 <li><a href="/world/world_109_126.html">Lake Country</a></li>
75 <li><a href="/world/world_122_117.html">Navar</a></li>
76 <li><a href="/world/world_116_102.html">Darcap</a></li>
77 <li><a href="/world/world_128_109.html">Wolfsburg</a></li>
78 <li><a href="/world/world_128_101.html">Azumauindo</a></li>
79</ul>
80<hr />
81<p style='font-size: 8pt;'>created by <b>update</b> version $VERSION</p>
82EOF
50 echo "</ul></body></html>" >&7 83 echo "</body></html>" >&7
51 } 7>index.html 84 } 7>index.html
52 ) 85 )
53done 86done
54 87
55<.cfmap2html xargs cfmap2html 88<.cfmap2html xargs cfmap2html
89rm -f .cfmap2html
90
91cfarch2html
92cfworldmap
93
94chown -R root.root .
95chmod -R u=rwX,go=rX .
96

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines