Skip to content

Commit da4669c

Browse files
committed
Apache RAT update:
* Update to use version 0.17 * Reformat / cleanup RAT script. * Do not use deprecated RAT flags. * Update .ratignore to exclude generated files. * Remove RAT output awk filter, use --output-style unapproved-licenses option instead.
1 parent e5d930e commit da4669c

2 files changed

Lines changed: 18 additions & 22 deletions

File tree

.ratignore

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44
README.md
55
CHANGELOG.md
66
tags
7-
Version.cc
87
sorttable.js
9-
108
# Directories
119
ext
1210
wiki
1311
build
14-
go.sum
12+
13+
# Generated/auto-generated files
14+
src/cc/common/Version.cc
15+
src/go/go.sum
16+
src/go/README.md
17+
18+
# Specific gitignore files
19+
src/cc/common/.gitignore
20+
webui/.gitignore

scripts/rat.sh

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ if [ $# -ne 1 ]; then
2323
exit 1
2424
fi
2525

26-
SRC="`cd "$1" > /dev/null && pwd`"
26+
SRC="$(cd "$1" >/dev/null && pwd)"
2727

28-
MYRAT_VERS=0.16.1
28+
MYRAT_VERS=0.17
2929
MYURL="https://downloads.apache.org/creadur/apache-rat-${MYRAT_VERS}/apache-rat-${MYRAT_VERS}-bin.tar.gz"
3030
MYSHAURL="https://dlcdn.apache.org/creadur/apache-rat-${MYRAT_VERS}/apache-rat-${MYRAT_VERS}-bin.tar.gz.sha512"
31-
MYTAR="`basename "$MYURL"`"
32-
MYNAME="`basename "$MYTAR" -bin.tar.gz`"
31+
MYTAR=$(basename "$MYURL")
32+
MYNAME=$(basename "$MYTAR" -bin.tar.gz)
3333
MYJAR="$MYNAME/$MYNAME.jar"
3434

3535
if [ -f "$MYJAR" ]; then
3636
true
3737
else
3838
rm -f "$MYTAR"
3939
if curl --retry 3 -Ss -o "$MYTAR" "$MYURL"; then
40-
MYTARSHA="`curl --retry 3 -Ss "$MYSHAURL" \
41-
| sed -e 's/^.*://' | tr -d ' \n' | tr ABCDEF abcdef`"
42-
MYACTSHA="`openssl sha512 < "$MYTAR" | sed -e 's/^.*)= *//'`"
40+
MYTARSHA=$(curl --retry 3 -Ss "$MYSHAURL" |
41+
sed -e 's/^.*://' | tr -d ' \n' | tr ABCDEF abcdef)
42+
MYACTSHA=$(openssl sha512 <"$MYTAR" | sed -e 's/^.*)= *//')
4343
if [ x"$MYACTSHA" = x"$MYTARSHA" ]; then
4444
true
4545
else
@@ -60,15 +60,5 @@ else
6060
fi
6161
fi
6262

63-
java -jar "$MYJAR" --dir "$SRC" -E "$SRC/.ratignore" \
64-
| awk '
65-
BEGIN { ret = 1; }
66-
/Unknown Licenses/ {
67-
if (0 == $1) {
68-
ret = 0
69-
}
70-
print;
71-
}
72-
/^==/{ print; }
73-
END { exit ret; }
74-
'
63+
java -jar "$MYJAR" --output-style unapproved-licenses \
64+
--input-exclude-file "$SRC/.ratignore" -- "$SRC"

0 commit comments

Comments
 (0)