copyblob.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. cat > copyblob.txt <<EOF
  3. // Copyright (C) 2004-2021 Artifex Software, Inc.
  4. //
  5. // This file is part of MuPDF.
  6. //
  7. // MuPDF is free software: you can redistribute it and/or modify it under the
  8. // terms of the GNU Affero General Public License as published by the Free
  9. // Software Foundation, either version 3 of the License, or (at your option)
  10. // any later version.
  11. //
  12. // MuPDF is distributed in the hope that it will be useful, but WITHOUT ANY
  13. // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  14. // FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  15. // details.
  16. //
  17. // You should have received a copy of the GNU Affero General Public License
  18. // along with MuPDF. If not, see <https://www.gnu.org/licenses/agpl-3.0.en.html>
  19. //
  20. // Alternative licensing terms are available from the licensor.
  21. // For commercial licensing, see <https://www.artifex.com/> or contact
  22. // Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
  23. // CA 94129, USA, for further information.
  24. EOF
  25. for F in $(find platform source include -name '*.[ch]' -or -name '*.java' -or -name '*.js')
  26. do
  27. if grep -q 'Copyright\|automatically generated file\|file was generated by\|DO NOT EDIT THIS FILE\|public domain' $F
  28. then
  29. touch .
  30. else
  31. echo $F
  32. cat copyblob.txt $F > copyblob-tmp.txt && mv copyblob-tmp.txt $F
  33. fi
  34. done