Marcel Telka
2023-11-14 2de8b5fe453d0c43d8dc957e57bf6c23e578adc2
tools/license-detector: SOFTWARE is optional for BSD-2-Clause and make its matching more robust

1 files modified
14 ■■■■ changed files
tools/licenses/license.BSD-2-Clause.filter 14 ●●●● patch | view | raw | blame | history
tools/licenses/license.BSD-2-Clause.filter
@@ -15,11 +15,19 @@
# Copyright 2022 Marcel Telka
#
sed -n \
sed \
    -e 's/`\{1,2\}/"/g' -e "s/'\{1,2\}/\"/g" \
    -e 's/[12]\./*/g' \
    -e 's/\* *//g' \
    -e 's/\(THIS SOFTWARE IS PROVIDED BY\).*\("AS IS" AND ANY\).*\(OR IMPLIED WARRANTIES\)/\1 REPLACEABLE \2 REPLACEABLE \3/I' \
    -e 's/THIS SOFTWARE/THIS/I' \
    -e 's/^\(THIS IS PROVIDED BY\).*\("AS IS" AND ANY\).*\(OR IMPLIED WARRANTIES\)/\1 REPLACEABLE \2 REPLACEABLE \3/I' \
    -e 's/\(IN NO EVENT SHALL\).*\(BE LIABLE\)/\1 REPLACEABLE \2/I' \
    -e 's/^.*\(Redistribution and use\)/\1/I' \
    -e '/^Redistribution and use/I,/^THIS SOFTWARE/Ip'
| sed -n \
    -e '{    1 {    N
            N
        }
        N
        /^Redistribution and use.*\n.*\n.*\nTHIS IS PROVIDED BY/Ip
        D
    }'