bump-version.sh 815 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh +v
  2. # Start from the build directory, where the version file is located
  3. if [ -f build/version ]; then
  4. cd build
  5. fi
  6. if [ \! -f version ]; then
  7. echo "Can't find version file"
  8. exit 1
  9. fi
  10. # Update the build number in the 'version' file.
  11. # Separate number from additional alpha/beta/etc marker
  12. MARKER=`cat version | sed 's/[0-9.]//g'`
  13. # Bump the number
  14. VN=`cat version | sed 's/[^0-9.]//g'`
  15. # Reassemble and write back out
  16. VN=$(($VN + 1))
  17. rm -f version.old
  18. mv version version.old
  19. chmod +w version.old
  20. echo $VN$MARKER > version
  21. VS="$(($VN/1000000)).$(( ($VN/1000)%1000 )).$(( $VN%1000 ))$MARKER"
  22. cd ..
  23. ANNOUNCE=`date +"%b %d, %Y:"`" libarchive $VS released"
  24. echo $ANNOUNCE
  25. # Add a version notice to NEWS
  26. mv NEWS NEWS.bak
  27. chmod +w NEWS.bak
  28. echo $ANNOUNCE >> NEWS
  29. echo >> NEWS
  30. cat NEWS.bak >> NEWS