tools/license-detector: case insensitive matching
| | |
| | | | sed -E -e 's/[[:space:]]+/ /g' -e 's/^ //' -e 's/ \$//' -e '/^\$/d' \\ |
| | | EOF |
| | | # Apply filter if any |
| | | [[ -x "$l.filter" ]] && printf '\t| %s \\\n' "$l.filter" >> "$TMPFILE" |
| | | [[ -x "$l.filter" ]] && printf '\t| LC_ALL=C %s \\\n' "$l.filter" >> "$TMPFILE" |
| | | cat <<#EOF >> "$TMPFILE" |
| | | | LC_ALL=C tr '[:upper:]' '[:lower:]' \\ |
| | | | tr ' ' '\\n' | fmt |
| | | EOF |
| | | |
| | |
| | | # |
| | | |
| | | sed -n \ |
| | | -e 's/\(Copyright\) .*/\1 REPLACEABLE/' \ |
| | | -e '/^Copyright/,/^Unless required by applicable law or agreed to in writing,/p' |
| | | -e 's/\(Copyright\) .*/\1 REPLACEABLE/I' \ |
| | | -e '/^Copyright/I,/^Unless required by applicable law or agreed to in writing,/Ip' |
| | |
| | | # |
| | | |
| | | sed -n \ |
| | | -e 's/^.*\(This Source Code Form is subject\)/\1/' \ |
| | | -e '/Mozilla Public License, v\. 2\.0/p' |
| | | -e 's/^.*\(This Source Code Form is subject\)/\1/I' \ |
| | | -e '/Mozilla Public License, v\. 2\.0/Ip' |
| | |
| | | # |
| | | |
| | | sed -n \ |
| | | -e '/^Permission to use, copy, modify,/,/^THE SOFTWARE IS PROVIDED/p' |
| | | -e '/^Permission to use, copy, modify,/I,/^THE SOFTWARE IS PROVIDED/Ip' |
| | |
| | | # |
| | | |
| | | sed -n \ |
| | | -e '/Definitions\./,/Accepting Warranty or Additional Liability\./p' |
| | | -e '/Definitions\./I,/Accepting Warranty or Additional Liability\./Ip' |
| | |
| | | -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/' \ |
| | | -e 's/\(IN NO EVENT SHALL\).*\(BE LIABLE\)/\1 REPLACEABLE \2/' \ |
| | | -e 's/^.*\(Redistribution and use\)/\1/' \ |
| | | -e '/^Redistribution and use/,/^THIS SOFTWARE/p' |
| | | -e 's/\(THIS SOFTWARE 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 's/``/"/g' -e "s/''/\"/g" \ |
| | | -e 's/[123]\.//g' \ |
| | | -e '/^Redistribution and use/,/^THIS SOFTWARE/p' |
| | | -e '/^Redistribution and use/I,/^THIS SOFTWARE/Ip' |
| | |
| | | -e 's/``/"/g' -e "s/''/\"/g" \ |
| | | -e 's/[123]\./*/g' \ |
| | | -e 's/- /* /g' \ |
| | | -e 's/^Neither/* &/' \ |
| | | -e 's/\*[^*]*\(be used to endorse or promote products\)/* REPLACEABLE \1/' \ |
| | | -e 's/^Neither/* &/I' \ |
| | | -e 's/\*[^*]*\(be used to endorse or promote products\)/* REPLACEABLE \1/I' \ |
| | | -e 's/\* *//g' \ |
| | | -e 's/\(THIS SOFTWARE IS PROVIDED BY\).*\("AS IS" AND ANY\).*\(OR IMPLIED WARRANTIES\)/\1 REPLACEABLE \2 REPLACEABLE \3/' \ |
| | | -e 's/\(IN NO EVENT SHALL\).*\(BE LIABLE\)/\1 REPLACEABLE \2/' \ |
| | | -e '/^Redistribution and use/,/^THIS SOFTWARE/p' |
| | | -e 's/\(THIS SOFTWARE 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 '/^Redistribution and use/I,/^THIS SOFTWARE/Ip' |
| | |
| | | # |
| | | |
| | | sed -n \ |
| | | -e 's/^GNU GENERAL PUBLIC LICENSE \(TERMS AND CONDITIONS\)/\1/' \ |
| | | -e '/^Copyright (C) 1989, 1991 Free Software Foundation, Inc\./,/IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW/p' |
| | | -e 's/^GNU GENERAL PUBLIC LICENSE \(TERMS AND CONDITIONS\)/\1/I' \ |
| | | -e '/^Copyright (C) 1989, 1991 Free Software Foundation, Inc\./I,/IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW/Ip' |
| | | |
| | | # We allow alternative GPL-2.0 wording |
| | | # see https://github.com/spdx/license-list-XML/issues/2204 |
| | |
| | | # |
| | | |
| | | sed -n \ |
| | | -e '/^Copyright (C) 2007 Free Software Foundation, Inc\./,/^If the disclaimer of warranty and limitation of liability/p' |
| | | -e '/^Copyright (C) 2007 Free Software Foundation, Inc\./I,/^If the disclaimer of warranty and limitation of liability/Ip' |
| | |
| | | # |
| | | |
| | | sed -n \ |
| | | -e 's/\(the above copyright notice\) .* \(in all copies\)/\1 REPLACEABLE \2/' \ |
| | | -e 's/\(all copies\), and \(that both\)/\1 \2/' \ |
| | | -e 's/\(that both\) \(that \)\{0,1\}\(the \)\{0,1\}\(copyright notice\)/\1 \4/' \ |
| | | -e 's/\(appear in supporting documentation\).*/\1/' \ |
| | | -e '/^Permission to use, copy, modify and distribute this software/p' |
| | | -e 's/\(the above copyright notice\) .* \(in all copies\)/\1 REPLACEABLE \2/I' \ |
| | | -e 's/\(all copies\), and \(that both\)/\1 \2/I' \ |
| | | -e 's/\(that both\) \(that \)\{0,1\}\(the \)\{0,1\}\(copyright notice\)/\1 \4/I' \ |
| | | -e 's/\(appear in supporting documentation\).*/\1/I' \ |
| | | -e '/^Permission to use, copy, modify and distribute this software/Ip' |
| | |
| | | # |
| | | |
| | | sed -n \ |
| | | -e 's/and \{0,1\}\/or distribute/and distribute/' \ |
| | | -e 's/\(AND\) .* \(DISCLAIMS ALL WARRANTIES\)/\1 REPLACEABLE \2/' \ |
| | | -e 's/\(IN NO EVENT SHALL\) .* \(BE LIABLE FOR ANY\)/\1 REPLACEABLE \2/' \ |
| | | -e '/^Permission to use, copy, modify/,/^THE SOFTWARE IS PROVIDED/p' \ |
| | | -e '/^THE SOFTWARE IS PROVIDED/q' |
| | | -e 's/and \{0,1\}\/or distribute/and distribute/I' \ |
| | | -e 's/\(AND\) .* \(DISCLAIMS ALL WARRANTIES\)/\1 REPLACEABLE \2/I' \ |
| | | -e 's/\(IN NO EVENT SHALL\) .* \(BE LIABLE FOR ANY\)/\1 REPLACEABLE \2/I' \ |
| | | -e '/^Permission to use, copy, modify/I,/^THE SOFTWARE IS PROVIDED/Ip' \ |
| | | -e '/^THE SOFTWARE IS PROVIDED/Iq' |
| | |
| | | # |
| | | |
| | | sed -n \ |
| | | -e 's/.*\(Everyone is permitted\)/\1/' \ |
| | | -e 's/^GNU LIBRARY GENERAL PUBLIC LICENSE \(TERMS AND CONDITIONS\)/\1/' \ |
| | | -e '/^Everyone is permitted/,/IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW/p' |
| | | -e 's/.*\(Everyone is permitted\)/\1/I' \ |
| | | -e 's/^GNU LIBRARY GENERAL PUBLIC LICENSE \(TERMS AND CONDITIONS\)/\1/I' \ |
| | | -e '/^Everyone is permitted/I,/IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW/Ip' |
| | | |
| | | # We allow alternative LGPL-2.0 wording |
| | | # see https://github.com/spdx/license-list-XML/issues/2204 |
| | |
| | | # |
| | | |
| | | sed -n \ |
| | | -e 's/^GNU LESSER GENERAL PUBLIC LICENSE \(TERMS AND CONDITIONS\)/\1/' \ |
| | | -e '/^Copyright (C) 1991, 1999 Free Software Foundation, Inc\./,/IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW/p' |
| | | -e 's/^GNU LESSER GENERAL PUBLIC LICENSE \(TERMS AND CONDITIONS\)/\1/I' \ |
| | | -e '/^Copyright (C) 1991, 1999 Free Software Foundation, Inc\./I,/IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW/Ip' |
| | | |
| | | # We allow alternative LGPL-2.1 wording |
| | | # see https://github.com/spdx/license-list-XML/issues/2204 |
| | |
| | | # |
| | | |
| | | gsed -u \ |
| | | -e '0,/^GNU LESSER GENERAL PUBLIC LICENSE/d' \ |
| | | -e '/^If the Library as you received it specifies that a proxy/q' ; cat > /dev/null |
| | | -e '0,/^GNU LESSER GENERAL PUBLIC LICENSE/Id' \ |
| | | -e '/^If the Library as you received it specifies that a proxy/Iq' ; cat > /dev/null |
| | |
| | | |
| | | sed -E -n \ |
| | | -e 's/“/"/g' -e 's/”/"/g' -e 's/``/"/g' -e 's/'\'\''/"/g' \ |
| | | -e '/^Permission is hereby granted/,/^THE SOFTWARE/p' \ |
| | | -e '/^THE SOFTWARE/q' |
| | | -e '/^Permission is hereby granted/I,/^THE SOFTWARE/Ip' \ |
| | | -e '/^THE SOFTWARE/Iq' |
| | |
| | | |
| | | sed -E -n \ |
| | | -e 's/“/"/g' -e 's/”/"/g' -e 's/``/"/g' -e 's/'\'\''/"/g' \ |
| | | -e 's/(obtaining a copy of).*(\(the "Software"\))/\1 REPLACEABLE \2/' \ |
| | | -e 's/(this permission notice).*(shall be included)/\1 \2/' \ |
| | | -e 's/(IN NO EVENT SHALL).*(BE LIABLE)/\1 REPLACEABLE \2/' \ |
| | | -e '/^Permission is hereby granted/,/^THE SOFTWARE/p' \ |
| | | -e '/^THE SOFTWARE/q' |
| | | -e 's/(obtaining a copy of).*(\(the "Software"\))/\1 REPLACEABLE \2/I' \ |
| | | -e 's/(this permission notice).*(shall be included)/\1 \2/I' \ |
| | | -e 's/(IN NO EVENT SHALL).*(BE LIABLE)/\1 REPLACEABLE \2/I' \ |
| | | -e '/^Permission is hereby granted/I,/^THE SOFTWARE/Ip' \ |
| | | -e '/^THE SOFTWARE/Iq' |
| | |
| | | -e 's/ \(\* \)\{1,\}/ /g' -e 's/^\* //' -e 's/ \*$//' \ |
| | | -e 's/ -\{3,\} / /g' -e 's/ -\{3,\}$//' \ |
| | | -e 's/ \*\{3,\} / /g' -e 's/^\*\{3,\} //' -e 's/ \*\{3,\}$//' -e '/^\*\{3,\}$/d' \ |
| | | -e 's/^\([abc]\)\. /(\1) /g' \ |
| | | -e '/Definitions$/,/Exhibit B of this License must be attached\.$/p' |
| | | -e 's/^\([abc]\)\. /(\1) /Ig' \ |
| | | -e '/Definitions$/I,/Exhibit B of this License must be attached\.$/Ip' |
| | |
| | | |
| | | sed -n \ |
| | | -e 's/^[1-8]\. \{1,\}//' \ |
| | | -e 's/\(Copyright (c)\) .* \(Python Software Foundation\)/\1 \2/' \ |
| | | -e '/^This LICENSE AGREEMENT is between the Python Software Foundation/,/By copying, installing or otherwise using Python/p' |
| | | -e 's/\(Copyright (c)\) .* \(Python Software Foundation\)/\1 \2/I' \ |
| | | -e '/^This LICENSE AGREEMENT is between the Python Software Foundation/I,/By copying, installing or otherwise using Python/Ip' |
| | |
| | | # |
| | | |
| | | sed -n \ |
| | | -e '/^This is free and unencumbered software/,/^THE SOFTWARE IS PROVIDED/p' |
| | | -e '/^This is free and unencumbered software/I,/^THE SOFTWARE IS PROVIDED/Ip' |
| | |
| | | # |
| | | |
| | | sed -n \ |
| | | -e '/^Redistribution and use in source and binary forms,/,/^THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS/p' |
| | | -e '/^Redistribution and use in source and binary forms,/I,/^THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS/Ip' |