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.

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. version=$1
  3. if [ "$version" = "" ]
  4. then
  5. echo "Usage: $0 <version to set>"
  6. exit 1
  7. fi
  8. scriptdir=`dirname $0`
  9. basedir=$scriptdir"/.."
  10. sincefiles=`find $basedir -name "*.java"|xargs egrep -Hi "(@since$|@since $)"|grep -v "./work/"|grep -v "./uitest/"|grep -v "/tests/"|cut -d: -f 1|sort|uniq`
  11. # Stupid feature detection using an invalid parameter.
  12. # Mac requires a parameter for the -i option (creates a backup file with that suffix)
  13. # Linux does not support any parameters for -i
  14. mac=`sed --foobaryeano 2>&1|grep -- "-i extension"`
  15. if [ "$mac" = "" ]
  16. then
  17. sedCmd="sed -i"
  18. else
  19. sedCmd="sed -i backup"
  20. fi
  21. for f in $sincefiles
  22. do
  23. echo "Fixing $f..."
  24. $sedCmd "s/@since\$/@since $version/g" $f
  25. $sedCmd "s/@since \$/@since $version/g" $f
  26. done