File: addlicense.sh

package info (click to toggle)
biojava5-live 5.4.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 110,812 kB
  • sloc: java: 257,052; xml: 27,480; python: 64; sh: 43; makefile: 39
file content (14 lines) | stat: -rwxr-xr-x 385 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
# Adds the BioJava LGPL license statement to the top of every java file

BASEDIR=$(dirname "$0")

find . -iname '*.java' -exec grep -L 'http://www.gnu.org/copyleft/lesser.html' '{}' '+'|
xargs grep -Li 'copyright' |
while read file; do
    echo "$file"
    cat $BASEDIR/../HEADER.txt > tmp.java
    echo >> tmp.java
    cat "$file" >> tmp.java
    mv tmp.java "$file"
done