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.

72 lines
2.7 KiB

  1. #!/bin/sh
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: bin/sde-cleanup-linger
  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. #Description: Removes temp files and search for lingering files
  18. #Alias: lingering
  19. [ -n "$SDEROOT" ] ||
  20. export SDEROOT=$( cd "${0%/*}/.."; pwd -P )
  21. . $SDEROOT/lib/libsde.in
  22. if [ $# -ne 0 ]; then
  23. echo "Usage: sde cleanup linger"
  24. exit 1
  25. fi
  26. echo "Searching for lingering temp/backup files (this may take some time) ..."
  27. sderootdirs="scripts/. bin/. etc/. lib/. doc/. src/. package/. architecture/. target/."
  28. # Remove temp/backup files
  29. #
  30. $SDEROOT/bin/find $sderootdirs -type f \( -name '*~' -o \
  31. -name 'a.out' -o -name 'core.*' -o -name 'core' \) | xargs rm -vf
  32. # Print warnings for 'lingering' files
  33. # (we have to distinguish between the targets and the rest)
  34. #
  35. sderootdirs=${sderootdirs% target/.}
  36. $SDEROOT/bin/find ${sderootdirs} \( \
  37. \( -name 'DEADJOE' -o -name '*-[xX]' -o -name '.[^.]*' \
  38. -o -name '*.orig' -o -name '*.rej' -o -name '*#*' \
  39. -o -name '*.mine' -o -name '*.r[1-9][0-9]*' \
  40. -o -name TRANS.TBL -o -name '*.cksum-err' -o -name x \
  41. -o -name '*[.-]old' -o -name a.out -o -name '*~' \
  42. -o -name '*.incomplete' -o -name '*.ckext-err' \) \
  43. -printf 'WARNING: Found %p\n' \
  44. \) -o \( \
  45. \( ! -type d ! -type f \) \
  46. -printf 'WARNING: Neither a dir nor a regular file: %p\n' \
  47. \)
  48. # for targets we tolerate .files
  49. $SDEROOT/bin/find target/. \
  50. \( \
  51. \( -name 'DEADJOE' -o -name '*-[xX]' \
  52. -o -name '*.orig' -o -name '*.rej' -o -name '*#*' \
  53. -o -name '*.mine' -o -name '*.r[1-9][0-9]*' \
  54. -o -name TRANS.TBL -o -name '*.cksum-err' -o -name x \
  55. -o -name '*[.-]old' -o -name a.out -o -name '*~' \
  56. -o -name '*.incomplete' -o -name '*.ckext-err' \) \
  57. -printf 'WARNING: Found %p\n' \
  58. \) -o \( \
  59. \( ! -type d ! -type f \) \
  60. -printf 'WARNING: Neither a dir nor a regular file: %p\n' \
  61. \)
  62. exit 0