source-check.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. cd "$1"/..
  3. git show > /dev/null 2> /dev/null || { cat tests/ref/fate/source ; exit 0; }
  4. echo Files without standard license headers:
  5. git grep -L -E "This file is part of FFmpeg|This file is part of libswresample|"\
  6. "Permission to use, copy, modify, and/or distribute this software for any|"\
  7. "Permission is hereby granted, free of charge, to any person|"\
  8. "Permission is hereby granted to use, copy, modify, and distribute this|"\
  9. "Permission is granted to anyone to use this software for any purpose|"\
  10. "This work is licensed under the terms of the GNU GPL|"\
  11. "Redistribution and use in source and binary forms, with or without modification|"\
  12. "This library is free software; you can redistribute it and/or|"\
  13. "This program is free software; you can redistribute it and/or modify|"\
  14. "This file is placed in the public domain" | grep -E '\.c$|\.h$|\.S$|\.asm$'
  15. echo Headers without standard inclusion guards:
  16. for f in `git ls-files | grep '\.h$'` ; do
  17. macro="`echo $f | sed \
  18. -e 's/^lib//' \
  19. -e 's/[^A-Za-z0-9]\{1,\}/_/g' \
  20. -e 's/_af_/_/' \
  21. -e 's/_vf_/_/' \
  22. -e 's/_avf_/_/' \
  23. -e 's/_vaf_/_/' \
  24. | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`"
  25. grep -L "^#define $macro$" $f
  26. done
  27. exit 0