Meta/Make: do not check old-style-def while compiling older revisions.
[git] / Gitweb
1 #!/bin/sh
2
3 Meta/Make gitweb/gitweb.cgi
4
5 cd gitweb &&
6 DEST=`cd ../../index && /bin/pwd` || exit
7
8 differs=
9
10 if test -f "$DEST/gitweb.cgi"
11 then
12         diff -u "$DEST/gitweb.cgi" gitweb.cgi || differs="g$differs"
13 else
14         differs="g$differs"
15 fi
16
17 if test -f "$DEST/gitweb.css"
18 then
19         diff -u "$DEST/gitweb.css" gitweb.css || differs="s$differs"
20 else
21         differs="s$differs"
22 fi
23
24 if test -f "$DEST/git-favicon.png"
25 then
26         cmp "$DEST/git-favicon.png" git-favicon.png >/dev/null ||
27         differs="i$differs"
28 else
29         differs="i$differs"
30 fi
31
32 case "$differs" in
33 '')
34         echo Up to date. ;;
35 *)
36         while echo -n 'Update [y/N]? '
37         do
38                 read ans
39                 case "$ans" in
40                 [Yy])
41                         ans=y
42                         break ;;
43                 '' | [Nn])
44                         ans=n
45                         break ;;
46                 esac
47         done
48         case "$ans" in
49         y)      ;;
50         *)      exit
51         esac
52 esac
53
54 case "$differs" in
55 *g*)
56         rm -f "$DEST/gitweb.cgi"
57         cp gitweb.cgi "$DEST/gitweb.cgi"
58         chmod +x "$DEST/gitweb.cgi"
59         ;;
60 esac
61
62 case "$differs" in
63 *s*)
64         rm -f "$DEST/gitweb.css"
65         cp gitweb.css "$DEST/gitweb.css"
66         ;;
67 esac
68
69 case "$differs" in
70 *i*)
71         rm -f "$DEST/git-favicon.png"
72         cp git-favicon.png "$DEST/git-favicon.png"
73         ;;
74 esac