blob: ed8b4ff3e5874eac2f8ffe3486abe9d9668b27ce [file] [log] [blame]
Junio C Hamanoe6fc2342005-08-25 00:28:18 -07001#!/bin/sh
2
3T="$1"
4
Junio C Hamano530e7412007-11-24 23:48:04 -08005for h in \
6 *.txt *.html \
7 howto/*.txt howto/*.html \
8 technical/*.txt technical/*.html \
Nicolas Pitre761e7422010-09-06 20:29:57 -04009 RelNotes/*.txt *.css
Junio C Hamanoe6fc2342005-08-25 00:28:18 -070010do
Junio C Hamano530e7412007-11-24 23:48:04 -080011 if test ! -f "$h"
12 then
13 : did not match
14 elif test -f "$T/$h" &&
Junio C Hamano7e423322010-09-01 09:25:17 -070015 $DIFF -u -I'^Last updated ' "$T/$h" "$h"
Tilman Sauerbeck52db0492006-05-18 12:57:04 +020016 then
17 :; # up to date
18 else
Junio C Hamanoe6fc2342005-08-25 00:28:18 -070019 echo >&2 "# install $h $T/$h"
20 rm -f "$T/$h"
Elia Pinto2c4a0502014-04-16 10:29:46 -070021 mkdir -p $(dirname "$T/$h")
Junio C Hamanoe6fc2342005-08-25 00:28:18 -070022 cp "$h" "$T/$h"
Tilman Sauerbeck52db0492006-05-18 12:57:04 +020023 fi
Junio C Hamanoe6fc2342005-08-25 00:28:18 -070024done
Elia Pinto2c4a0502014-04-16 10:29:46 -070025strip_leading=$(echo "$T/" | sed -e 's|.|.|g')
Junio C Hamano530e7412007-11-24 23:48:04 -080026for th in \
27 "$T"/*.html "$T"/*.txt \
28 "$T"/howto/*.txt "$T"/howto/*.html \
29 "$T"/technical/*.txt "$T"/technical/*.html
Junio C Hamanoe6fc2342005-08-25 00:28:18 -070030do
Elia Pinto2c4a0502014-04-16 10:29:46 -070031 h=$(expr "$th" : "$strip_leading"'\(.*\)')
Junio C Hamanoe6fc2342005-08-25 00:28:18 -070032 case "$h" in
Junio C Hamano3a4e6c72010-09-09 16:17:59 -070033 RelNotes-*.txt | index.html) continue ;;
Junio C Hamanoe6fc2342005-08-25 00:28:18 -070034 esac
35 test -f "$h" && continue
36 echo >&2 "# rm -f $th"
37 rm -f "$th"
38done
39ln -sf git.html "$T/index.html"