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.

50 lines
1.5 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/cacheinjector.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"
  19. shift; shift
  20. fi
  21. if [ ! -f config/$config/config ]; then
  22. echo "ERROR: '$config' is not a valid config name"
  23. exit 1
  24. fi
  25. eval `grep SDECFG_ID= config/$config/config`
  26. FILTER="sed -n -e 's|\[SIZE\].*MB, \\([0-9].*\\)|[SIZE] \1|p' -e '/\\(gawk\|patch\\)/ d;' -e '/^\[DEP\]/ p;'"
  27. echo package/*/*/ | tr ' ' '\n' |
  28. sed -e "s,^\(.*\)/\(.*\)/\(.*\)/,\3 build/$SDECFG_ID/var/adm/cache/\3 \1/\2/\3/\3.cache," |
  29. while read pkg new original; do
  30. if [ -f $new ]; then
  31. if [ ! -f $original ]; then
  32. echo "ADDING $original"
  33. cp $new $original
  34. svn add $original
  35. else
  36. eval "$FILTER $new" > $$.new
  37. eval "$FILTER $original" > $$.original
  38. if [ "$( diff -u $$.original $$.new )" ]; then
  39. echo "REPLACING $original"
  40. cp $new $original
  41. # else
  42. # echo "KEEPING $original"
  43. fi
  44. rm -f $$.original $$.new
  45. fi
  46. fi
  47. done