store_rpt 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/bash
  2. # ./store_rpt mv -v 1.34
  3. function do_cp {
  4. for r in $r
  5. do
  6. for f in $(grep -l "$grep$r" $m)
  7. do
  8. mkdir -p t/reports/$v/$r
  9. if test "$move" = "1"
  10. then
  11. mv $f t/reports/$v/$r/
  12. else
  13. cp -p $f t/reports/$v/$r/
  14. fi
  15. done
  16. done
  17. }
  18. if test "$1" = "mv"; then move=1; shift; fi
  19. if test "$1" = "-v"; then
  20. v=$2
  21. else
  22. v=`perl -ane'print $F[2] if /^VERSION =/' Makefile`
  23. fi
  24. m=$(ls log.modules-5.*|egrep -v ".(orig|err)")
  25. if [ -n "$m" ]; then
  26. r=$(perl -lane "print substr(\$F[4],1) if /VERSION = $v r/" $m)
  27. if [ -n "$r" ]; then
  28. grep="VERSION = $v r"
  29. else
  30. r=$(perl -lane "print \$F[4] if /^# B::C::VERSION = 1.\\d\\w+ \\w+ /" $m)
  31. grep="VERSION = $v "
  32. fi
  33. do_cp
  34. fi
  35. m=$(ls log.test-*-5.*|egrep -v ".(orig|err)")
  36. if [ -n "$m" ]; then
  37. r=$(perl -lane "print \$F[1] if /^Revision: \\d+\$/" $m)
  38. if [ -n "$r" ]; then
  39. # svn
  40. grep="Revision: "
  41. else
  42. # git
  43. r=$(perl -lane "print \$F[4] if /^# B::C::VERSION = 1.\\d\\w+ \\w+ /" $m)
  44. grep=" "
  45. fi
  46. do_cp
  47. fi