install-webdoc.sh 757 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. T="$1"
  3. for h in \
  4. *.txt *.html \
  5. howto/*.txt howto/*.html \
  6. technical/*.txt technical/*.html \
  7. RelNotes/*.txt *.css
  8. do
  9. if test ! -f "$h"
  10. then
  11. : did not match
  12. elif test -f "$T/$h" &&
  13. $DIFF -u -I'^Last updated ' "$T/$h" "$h"
  14. then
  15. :; # up to date
  16. else
  17. echo >&2 "# install $h $T/$h"
  18. rm -f "$T/$h"
  19. mkdir -p $(dirname "$T/$h")
  20. cp "$h" "$T/$h"
  21. fi
  22. done
  23. strip_leading=$(echo "$T/" | sed -e 's|.|.|g')
  24. for th in \
  25. "$T"/*.html "$T"/*.txt \
  26. "$T"/howto/*.txt "$T"/howto/*.html \
  27. "$T"/technical/*.txt "$T"/technical/*.html
  28. do
  29. h=$(expr "$th" : "$strip_leading"'\(.*\)')
  30. case "$h" in
  31. RelNotes-*.txt | index.html) continue ;;
  32. esac
  33. test -f "$h" && continue
  34. echo >&2 "# rm -f $th"
  35. rm -f "$th"
  36. done
  37. ln -sf git.html "$T/index.html"