TDE core libraries
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

update-entities.sh 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/bin/bash
  2. # A script to dynamically update general.entities with the current version release information.
  3. # As the help files are updated/revised, DocBook entities can be used rather than static strings for
  4. # release version, release date, and copyright date. This allows for a professional touch with each
  5. # updated help file to show the file is relevant to the current Trinity release.
  6. TDEVERSION_FILE="@CMAKE_SOURCE_DIR@/tdecore/tdeversion.h"
  7. ENTITIES_FILE="@CMAKE_SOURCE_DIR@/kdoctools/customization/entities/general.entities"
  8. echo "-- Updating $ENTITIES_FILE:"
  9. # Extract the Trinity version number.
  10. if [ -f "$TDEVERSION_FILE" ]; then
  11. TDE_RELEASE_VERSION="`grep TDE_VERSION_STRING \"$TDEVERSION_FILE\"`"
  12. #echo " TDE_RELEASE_VERSION: $TDE_RELEASE_VERSION"
  13. if [ -z "$TDE_RELEASE_VERSION" ]; then
  14. echo "Cannot determine the Trinity version number. Please verify $TDEVERSION_FILE exists."
  15. echo
  16. exit 1
  17. fi
  18. if [ -n "`echo \"$TDE_RELEASE_VERSION\" | grep DEVELOPMENT`" ]; then
  19. TDE_RELEASE_VERSION="`echo $TDE_RELEASE_VERSION | awk '{print $3,$4}' | sed -e 's/"//g'`"
  20. else
  21. TDE_RELEASE_VERSION="`echo $TDE_RELEASE_VERSION | awk '{print $3}' | sed -e 's/"//g'`"
  22. fi
  23. echo " TDE Release Version: $TDE_RELEASE_VERSION"
  24. if [ -z "$TDE_RELEASE_VERSION" ]; then
  25. echo "Cannot determine the Trinity version number. Please verify $TDEVERSION_FILE exists."
  26. echo
  27. exit 1
  28. fi
  29. else
  30. echo "Please verify $TDEVERSION_FILE exists."
  31. echo
  32. exit 1
  33. fi
  34. # $TDEVERSION_FILE (tdeversion.h) remains stagnant throughout the git cycle.
  35. # The internal release data is manually patched only for the official release.
  36. # Therefore the file date stamp does not change. As the development cycle
  37. # progresses, the file date stamp looks really old in the help handbooks. As
  38. # the tde-release-date entity eventually will match the official release file
  39. # date stamp, we can use the actual date up to that point, which looks nicer
  40. # in the handbooks during the development cycle.
  41. if [ -n "`echo \"$TDE_RELEASE_VERSION\" | grep DEVELOPMENT`" ]; then
  42. # Development cycle: use the actual date as the release date.
  43. TDE_RELEASE_DATE=`date +'%B %e, %Y'`
  44. else
  45. # Official release: extract the file date stamp as the release date.
  46. TDE_RELEASE_DATE=`find $TDEVERSION_FILE -printf "%TB %Te, %TY\n"`
  47. fi
  48. echo " TDE Release Date: $TDE_RELEASE_DATE"
  49. # Create a copyright date string. First release of Trinity was 3.5.11, April 29, 2010.
  50. TDE_RELEASE_COPYRIGHT="2010-`date +%Y`"
  51. echo " TDE Release Copyright: $TDE_RELEASE_COPYRIGHT"
  52. # Now update $ENTITIES_FILE.
  53. if [ -r "$ENTITIES_FILE" ]; then
  54. echo "" >> $ENTITIES_FILE
  55. echo -e "<!ENTITY tde-release-version \"${TDE_RELEASE_VERSION}\">" >> $ENTITIES_FILE
  56. echo -e "<!ENTITY tde-release-date \"${TDE_RELEASE_DATE}\">" >> $ENTITIES_FILE
  57. echo -e "<!ENTITY tde-copyright-date \"${TDE_RELEASE_COPYRIGHT}\">" >> $ENTITIES_FILE
  58. else
  59. echo "Please verify $ENTITIES_FILE exists."
  60. echo
  61. exit 1
  62. fi
  63. exit 0