deheader2.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env bash
  2. export LOGFILE2=logs/deheader2.log
  3. export DATA=$(cat ${LOGFILE})
  4. if [[ -z "${DATA}" ]]; then
  5. echo "Empty output. Probably wrong search flags."
  6. exit 1
  7. fi
  8. export DATA=$(grep "error:" ${LOGFILE})
  9. if [[ -n "${DATA}" ]]; then
  10. echo "Compilation error found"
  11. exit 1
  12. fi
  13. grep "deheader:" ${LOGFILE} \
  14. | grep -v "deheader: remove <climits> from ./src/being/localplayer.cpp" \
  15. | grep -v "deheader: remove <fstream> from ./src/utils/files.cpp" \
  16. | grep -v "deheader: remove <climits> from ./src/resources/map/map.cpp" \
  17. | grep -v "deheader: remove <sys/time.h> from ./src/resources/wallpaper.cpp" \
  18. | grep -v "deheader: remove <linux/tcp.h> from ./src/net/sdltcpnet.cpp" \
  19. | grep -v "deheader: remove <netdb.h> from ./src/net/sdltcpnet.cpp" \
  20. | grep -v "deheader: remove <netinet/in.h> from ./src/net/sdltcpnet.cpp" \
  21. | grep -v "deheader: remove <climits> from ./src/resources/map/map.cpp" \
  22. | grep -v "deheader: remove <vector> from ./src/utils/vector.h" \
  23. | grep -v "has more than one inclusion of \"resources/dye/dyepalette_replace" \
  24. | grep -v "/sdl2gfx/" \
  25. | grep -v "doctest.h" \
  26. | grep -v "deheader: remove <climits> from ./src/units.cpp" > ${LOGFILE2}
  27. export DATA=$(cat ${LOGFILE2})
  28. if [[ -n "${DATA}" ]]; then
  29. echo "Wrong include files found"
  30. echo ${DATA}
  31. exit 1
  32. fi