Source files of fsfe.org, pdfreaders.org, freeyourandroid.org, ilovefs.org, drm.info, and test.fsfe.org. Contribute: https://fsfe.org/contribute/web/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

scaffold.sh 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/sh
  2. inc_scaffold=true
  3. [ -z "$inc_xmlfiles" ] && . "$basedir/build/xmlfiles.sh"
  4. [ -z "$inc_translations" ] && . "$basedir/build/translations.sh"
  5. [ -z "$inc_filenames" ] && . "$basedir/build/filenames.sh"
  6. [ -z "$inc_fundraising" ] && . "$basedir/build/fundraising.sh"
  7. [ -z "$inc_sources" ] && . "$basedir/build/sources.sh"
  8. build_xmlstream(){
  9. # assemble the xml stream for feeding into xsltproc
  10. # the expected shortname and language flag indicate
  11. # a single xhtml page to be built
  12. shortname="$1"
  13. lang="$2"
  14. olang="$3"
  15. dirname="${shortname%/*}/"
  16. texts_xml=$(get_textsfile $lang)
  17. fundraising_xml=$(get_fundraisingfile $lang)
  18. date="$(date +%Y-%m-%d)"
  19. time="$(date +%H:%M:%S)"
  20. outdated=no
  21. if [ -f "${shortname}.${lang}.xhtml" ]; then
  22. act_lang="$lang"
  23. [ "${shortname}.${olang}.xhtml" -nt "${shortname}.${lang}.xhtml" ] && outdated=yes
  24. else
  25. act_lang="$olang"
  26. fi
  27. infile="${shortname}.${act_lang}.xhtml"
  28. cat <<-EOF
  29. <buildinfo
  30. date="$date"
  31. original="$olang"
  32. filename="/${shortname#$basedir/}"
  33. dirname="/${dirname#$basedir/}"
  34. language="$lang"
  35. outdated="$outdated"
  36. >
  37. <trlist>
  38. $(list_langs "$shortname")
  39. </trlist>
  40. <menuset>$(include_xml "$basedir/tools/menu-global.xml")</menuset>
  41. <textsetbackup>$(include_xml "$basedir/tools/texts-en.xml")</textsetbackup>
  42. <textset>$(include_xml "$texts_xml")</textset>
  43. <fundraising>$(include_xml "$fundraising_xml")</fundraising>
  44. <document
  45. language="$act_lang"
  46. $(get_attributes "$infile")
  47. >
  48. <timestamp>
  49. \$Date: $date $time \$
  50. \$Author: automatic \$
  51. </timestamp>
  52. <set>
  53. $(auto_sources "${shortname}.sources" "$lang")
  54. </set>
  55. $(include_xml "$infile")
  56. </document>
  57. </buildinfo>
  58. EOF
  59. }