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.

40 lines
1.3 KiB

  1. #!/bin/sh
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: lib/sde-package/pkgchksum.sh
  6. # Copyright (C) 2006 - 2008 The OpenSDE Project
  7. # Copyright (C) 2004 - 2006 The T2 SDE Project
  8. # Copyright (C) 1998 - 2003 Clifford Wolf
  9. #
  10. # More information can be found in the files COPYING and README.
  11. #
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; version 2 of the License. A copy of the
  15. # GNU General Public License can be found in the file COPYING.
  16. # --- SDE-COPYRIGHT-NOTE-END ---
  17. # This routine generates the package checksum of a $confdir.
  18. # The checksum includes the filenames and content (except of the .cache),
  19. # including subdirs but without whitespaces and comments and some tag lines
  20. # that are not vital for rebuilds during update checks.
  21. if [ -d "$1" ]; then
  22. cd "$1"
  23. # find all files (without hidden (e.g. .svn) files)
  24. find . ! -path '*/.*' ! -name '*.cache' -print -exec cat \{\} \; \
  25. 2>/dev/null |
  26. # strip some unimportant stuff (e.g. comments, whitespaces, ...)
  27. sed \
  28. -e '/^[ ]*#.*/d' \
  29. -e '/^\[COPY\]/d' \
  30. -e '/^\[CV-*\]/d' \
  31. -e '/^\[[T,I,U,A,M,L,S,C]\]/d' \
  32. -e 's/[\t ]*//g' \
  33. -e '/^ *$/d' |
  34. md5sum | cut -d ' ' -f 1
  35. else
  36. exit 1
  37. fi