cleantree.sh 700 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. basedir="$(dirname "$0")"
  3. [ "$(echo "$basedir" | cut -c1)" = '/' ] || basedir="$PWD/$basedir"
  4. basedir="$basedir/.."
  5. set -e
  6. if ! [ -x "$basedir/pilc-bootstrap.sh" ]; then
  7. echo "basedir sanity check failed"
  8. exit 1
  9. fi
  10. cd "$basedir"
  11. rm -f "$basedir"/*.html
  12. find "$basedir/deb" \( \
  13. \( -name '*.debhelper' \) -o \
  14. \( -name '*.log' \) -o \
  15. \( -name '*.substvars' \) -o \
  16. \( -name 'debhelper-build-stamp' \) \
  17. \) -print0 | xargs -0 rm -Rf
  18. for pkg in "$basedir/deb/pilc-system"; do
  19. rm -f "$pkg/debian/files"
  20. rm -Rf "$pkg/debian/pilc-system"
  21. rm -f "$pkg"*.deb
  22. rm -f "$pkg"*.build
  23. rm -f "$pkg"*.buildinfo
  24. rm -f "$pkg"*.changes
  25. rm -f "$pkg"*.dsc
  26. rm -f "$pkg"*.tar.xz
  27. done