]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/install-webdoc.sh
t4034: abstract away SHA-1-specific constants
[thirdparty/git.git] / Documentation / install-webdoc.sh
CommitLineData
e6fc2346
JH
1#!/bin/sh
2
3T="$1"
4
530e741c
JH
5for h in \
6 *.txt *.html \
7 howto/*.txt howto/*.html \
8 technical/*.txt technical/*.html \
761e742d 9 RelNotes/*.txt *.css
e6fc2346 10do
530e741c
JH
11 if test ! -f "$h"
12 then
13 : did not match
14 elif test -f "$T/$h" &&
7e42332e 15 $DIFF -u -I'^Last updated ' "$T/$h" "$h"
52db0495
TS
16 then
17 :; # up to date
18 else
e6fc2346
JH
19 echo >&2 "# install $h $T/$h"
20 rm -f "$T/$h"
2c4a050b 21 mkdir -p $(dirname "$T/$h")
e6fc2346 22 cp "$h" "$T/$h"
52db0495 23 fi
e6fc2346 24done
2c4a050b 25strip_leading=$(echo "$T/" | sed -e 's|.|.|g')
530e741c
JH
26for th in \
27 "$T"/*.html "$T"/*.txt \
28 "$T"/howto/*.txt "$T"/howto/*.html \
29 "$T"/technical/*.txt "$T"/technical/*.html
e6fc2346 30do
2c4a050b 31 h=$(expr "$th" : "$strip_leading"'\(.*\)')
e6fc2346 32 case "$h" in
3a4e6c72 33 RelNotes-*.txt | index.html) continue ;;
e6fc2346
JH
34 esac
35 test -f "$h" && continue
36 echo >&2 "# rm -f $th"
37 rm -f "$th"
38done
39ln -sf git.html "$T/index.html"