OpenSDE Framework (without history before r20070)
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.

69 lines
2.2 KiB

  1. #!/bin/sh
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: lib/misc/PackBuildInfo.sh
  6. # Copyright (C) 2008 The OpenSDE Project
  7. # Copyright (C) 2004 - 2006 The T2 SDE Project
  8. #
  9. # More information can be found in the files COPYING and README.
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; version 2 of the License. A copy of the
  14. # GNU General Public License can be found in the file COPYING.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. config=default
  17. if [ "$1" = "-cfg" ]; then
  18. config=$2; shift; shift
  19. fi
  20. if [ ! -f config/$config/config ]; then
  21. echo "ERROR: $config not found!"
  22. exit 1
  23. fi
  24. eval `grep "SDECFG_ID=" config/$config/config`
  25. if [ -z "$SDECFG_ID" -o ! -d build/$SDECFG_ID/var/adm/logs/ ]; then
  26. echo "ERROR: '$SDECFG' is not a valid build id!"
  27. exit 2
  28. fi
  29. tmpdir=`mktemp -d`
  30. rev=`svn info | sed -n 's,^Revision: \(.*\),\1,p'`
  31. mkdir -p $tmpdir/{config,cache,errlogs,flist} # logs
  32. echo "INFO: backuping configuration of $config ..." 1>&2
  33. cp -av config/$config/* $tmpdir/config/
  34. echo "INFO: creating build summary ..." 1>&2
  35. ./scripts/Create-ErrList -cfg $config 2>&1 | tee $tmpdir/summary
  36. echo "INFO: adding cache files ..." 1>&2
  37. #for x in $( cd build/$SDECFG_ID/var/adm/cache; ls -1 ); do
  38. # [ -s build/$SDECFG_ID/var/adm/cache/$x ] && \
  39. # cp build/$SDECFG_ID/var/adm/cache/$x $tmpdir/cache/
  40. cp build/$SDECFG_ID/var/adm/cache/* $tmpdir/cache/
  41. #done
  42. echo "INFO: adding log files ..." 1>&2
  43. #for x in $( cd build/$SDECFG_ID/var/adm/logs; ls -1 ); do
  44. # if [ -s build/$SDECFG_ID/var/adm/logs/$x ]; then
  45. # [[ $x == *.out ]] && continue
  46. # cp build/$SDECFG_ID/var/adm/logs/$x $tmpdir/logs/
  47. cp build/$SDECFG_ID/var/adm/logs/*.err $tmpdir/errlogs/
  48. # [[ $x == *.err ]] && ln -s ../logs/$x $tmpdir/errlogs/$x
  49. # fi
  50. #done
  51. echo "INFO: adding flist files ..." 1>&2
  52. #for x in $( cd build/$SDECFG_ID/var/adm/flists; ls -1 ); do
  53. # [ -s $x ] && cp build/$SDECFG_ID/var/adm/flists/$x $tmpdir/flist/
  54. cp build/$SDECFG_ID/var/adm/flists/* $tmpdir/flist/
  55. #done
  56. tar -C $tmpdir -jcf cachepack-$config-opensde-r${rev:-0}.tar.bz2 .
  57. rm -rf $tmpdir