mkrel 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #! /bin/sh
  2. #
  3. # mkrel
  4. #
  5. # Create a release for distribution.
  6. # This is a wrapper for mkrelease that syncs to the
  7. # Perforce head revision, reads the current
  8. # version from $POCO_BASE/VERSION and requires a release
  9. # specification (loaded from $POCO_BASE/release/spec/*.release)
  10. # as argument.
  11. #
  12. # usage: mkrel [<specfile>]
  13. #
  14. if [ "$POCO_BASE" = "" ] ; then
  15. echo "Error: POCO_BASE not set."
  16. exit 1
  17. fi
  18. cd $POCO_BASE
  19. if [ ! -f VERSION ] ; then
  20. echo "Error: No VERSION file found."
  21. exit 2
  22. fi
  23. case `uname` in
  24. CYGWIN*) cygwin=1
  25. ;;
  26. *) cygwin=""
  27. ;;
  28. esac
  29. label=""
  30. spec=""
  31. lineEndConv=""
  32. while [ "$1" != "" ] ;
  33. do
  34. if [ "$1" = "-l" ] ; then
  35. shift
  36. label=@$1
  37. shift
  38. elif [ "$1" = "-c" ] ; then
  39. shift
  40. lineEndConv=$1
  41. shift
  42. else
  43. spec=$1
  44. shift
  45. fi
  46. done
  47. if [ "$spec" != "" ] ; then
  48. relspec="-f release/spec/${spec}.release"
  49. reltag="-$spec"
  50. else
  51. relspec=""
  52. reltag=""
  53. fi
  54. if [ "$lineEndConv" != "" ] ; then
  55. lnendcvt="-c ${lineEndConv}"
  56. fi
  57. if [ $cygwin ] ; then
  58. export PWD=`cygpath -w $POCO_BASE`
  59. fi
  60. #
  61. # Sync files
  62. #
  63. if [ "$label" != "" ] ; then
  64. echo "Syncing files to ${label}..."
  65. p4 sync ./...$label
  66. fi
  67. read version <$POCO_BASE/VERSION
  68. release=$version$reltag
  69. #
  70. # Build release
  71. #
  72. echo "Building release $release"
  73. rm -rf releases/poco-$release.*
  74. $POCO_BASE/release/script/mkrelease $release $relspec $lnendcvt