manage_test_archives.sh 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #! /bin/sh
  2. set -e
  3. user=pertusus
  4. command=$1
  5. commands_list="(pack/packt2h/sign/signt2h/unpack/get/clean/upload)"
  6. if [ "z$command" = 'z' ]; then
  7. echo "Need something to do $commands_list"
  8. exit 1
  9. fi
  10. shift;
  11. download_dir="download-mirror.savannah.gnu.org/releases/texinfo"
  12. if [ z"$1" != 'z' ]; then
  13. VERSION=$1
  14. shift
  15. else
  16. VERSION=`grep '^VERSION = ' ../../Makefile | sed 's/^VERSION = *//'`
  17. fi
  18. if [ z"$VERSION" = 'z' ]; then
  19. echo "Cannot find version"
  20. exit 1
  21. fi
  22. if [ z"$1" != 'z' ]; then
  23. user=$1
  24. fi
  25. tp_tests_name=tp_tests_results-$VERSION
  26. texi2html_tests_name=t2h_tests_results
  27. files_tests_name=t2h_tests_files
  28. #manuals=t2h_tests_big_manuals
  29. if [ $command = 'packt2h' ]; then
  30. rm -f $texi2html_tests_name.tar.gz $files_tests_name.tar.gz #$manuals.tar.gz
  31. (
  32. cd ..
  33. tar c --exclude-vcs -z -f test/$texi2html_tests_name.tar.gz test/*/res/ test/*/res_all/ test/*/res_info/ test/*/res_html/ test/*/res_docbook/ test/*/res_xml/ test/many_input_files/*_res/
  34. tar c --exclude-vcs -z -f test/$files_tests_name.tar.gz test/info_coverage/f--ile*
  35. #tar c --exclude-vcs -z -f test/$manuals.tar.gz test/manuals/*.texi test/tar_manual/*.texi test/singular_manual/*.tex* test/singular_manual/d2t_singular/
  36. )
  37. elif [ $command = 'pack' ]; then
  38. rm -f $tp_tests_name.tar.gz
  39. (
  40. cd ..
  41. tar c --exclude-vcs -z -f test/$tp_tests_name.tar.gz test/*/res_parser*/
  42. )
  43. elif [ $command = 'get' ]; then :
  44. wget -N -r -np -A '*.tar.gz*' http://$download_dir/ || exit 1
  45. for file in $texi2html_tests_name $tp_tests_name $files_tests_name; do
  46. if [ -f $download_dir/$file.tar.gz ]; then
  47. cp -a $download_dir/$file.tar.gz ..
  48. else
  49. echo "WARNING: missing $download_dir/$file.tar.gz" 1>&2
  50. fi
  51. done
  52. elif [ $command = 'clean' ]; then
  53. rm -rf download-mirror.savannah.gnu.org
  54. rm -f $texi2html_tests_name.tar.gz $tp_tests_name.tar.gz $files_tests_name.tar.gz
  55. rm -f ../$texi2html_tests_name.tar.gz ../$tp_tests_name.tar.gz ../$files_tests_name.tar.gz
  56. elif [ $command = 'unpack' ]; then
  57. (
  58. cd ..
  59. for file in $files_tests_name $texi2html_tests_name $tp_tests_name; do
  60. if [ -f $file.tar.gz ]; then
  61. tar x -z -f $file.tar.gz
  62. else
  63. echo "WARNING: missing $file.tar.gz" 1>&2
  64. fi
  65. done
  66. #tar x -z -f test/$manuals.tar.gz
  67. )
  68. for dir in */; do
  69. if [ -f "$dir/htmlxref.cnf-texinfo" ]; then
  70. mkdir -p $dir/.texinfo/
  71. cp -p "$dir/htmlxref.cnf-texinfo" $dir/.texinfo/
  72. fi
  73. if [ -f "$dir/htmlxref.cnf-ref" ]; then
  74. cp -p "$dir/htmlxref.cnf-ref" $dir/htmlxref.cnf
  75. fi
  76. done
  77. cp -p sectioning/renamednodes.cnf-ref sectioning/equivalent_nodes-noderename.cnf
  78. elif [ $command = 'sign' ]; then
  79. mkdir -p ../upload
  80. cp -a $tp_tests_name.tar.gz ../upload
  81. gpg -b --use-agent ../upload/$tp_tests_name.tar.gz
  82. elif [ $command = 'signt2h' ]; then
  83. mkdir -p ../upload
  84. cp -a $texi2html_tests_name.tar.gz $files_tests_name.tar.gz ../upload
  85. gpg -b --use-agent ../upload/$texi2html_tests_name.tar.gz
  86. gpg -b --use-agent ../upload/$files_tests_name.tar.gz
  87. elif [ $command = 'upload' ]; then
  88. rsync -a -essh ../upload/ $user@dl.sv.gnu.org:/releases/texinfo/
  89. else
  90. echo "Unknown command $commands_list"
  91. exit 1
  92. fi