blob: aceeeb831faf5c99200464dbd77606403fc9c9fb [file] [log] [blame]
Martin Roth0ad5fbd2020-12-24 12:06:38 -07001#!/usr/bin/env sh
Patrick Georgi1afe2862020-05-10 17:34:15 +02002# SPDX-License-Identifier: ISC
Patrick Georgi32703692015-06-26 23:23:21 +02003
Patrick Georgiee0028d2015-10-13 22:11:13 +02004filelist=$(git ls-files $* | \
5 grep -Ev "^($(git submodule status |cut -d' ' -f3 |tr '\012' '|' | sed "s,|$,,"))$" | \
6 grep -Ev "\.patch$|_shipped$|\<LICENSE_GPL$|\<LGPL.txt$|\<COPYING$|\<DISCLAIMER$|^util/kconfig/|\<no-fsf-addresses.sh$")
7
Patrick Georgi32703692015-06-26 23:23:21 +02008sed -i \
9 -e "s:Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *MA[, ]*02110-1301[, ]*USA:Foundation, Inc.:" \
Patrick Georgiee0028d2015-10-13 22:11:13 +020010 -e "s:Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *MA[, ]*02110-1301[, ]*\$$:Foundation, Inc.:" \
Patrick Georgi32703692015-06-26 23:23:21 +020011 -e "s:Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA:Foundation, Inc.:" \
12 -e "s:Foundation, Inc., 59 Temple Place[-, ]*Suite 330, Boston, MA *02111-1307[, ]*USA:Foundation, Inc.:" \
13 -e "s:Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.:Foundation, Inc.:" \
Patrick Georgiee0028d2015-10-13 22:11:13 +020014 -e "/Foundation, Inc./ {N;s:Foundation, Inc.* USA\.* *:Foundation, Inc. :;s:Foundation, Inc. $:Foundation, Inc.:}" \
15 $filelist
16
17sed -i \
18 -e "/^[ \t\*#/-]*$/ {
19 N
20 /You should have received a copy of the GNU/ {
21 N
22 /You should have received a copy of the GNU.*along with this program\.[\., ]*$/ d
23 /You should have received a copy of the GNU.*[iI]f not, write to[^[:alnum:]]*the Free.*Software[^[:alnum:]]*Foundation,[^[:alnum:]]*Inc\.[\., ]*$/ d
24 /You should have received a copy of the GNU.*[iI]f not, see.*http:\/\/www.gnu.org\/licenses\/>[\. ]*$/ d
25 N
26 /You should have received a copy of the GNU.*[iI]f not, write to[^[:alnum:]]*the Free.*Software[^[:alnum:]]*Foundation,[^[:alnum:]]*Inc\.[\., ]*$/ d
27 /You should have received a copy of the GNU.*[iI]f not, write to[^[:alnum:]]*the Free.*Software[^[:alnum:]]*Foundation,[^[:alnum:]]*Inc\.[\., ]*\*\// s:^.*\*/:\*/:
28 /You should have received a copy of the GNU.*[iI]f not, write to[^[:alnum:]]*the Free.*Software[^[:alnum:]]*Foundation[\., ]*\*\// s:^.*\*/:\*/:
29 /You should have received a copy of the GNU.*[iI]f not, see.*http:\/\/www.gnu.org\/licenses\/>[\. ]*$/ d
30 N
31 /You should have received a copy of the GNU.*[iI]f not, see.*http:\/\/www.gnu.org\/licenses\/>[\. ]*$/ d
32 /You should have received a copy of the GNU.*[iI]f not, see.*http:\/\/www.gnu.org\/licenses\/>[\. ]*\*\// s:^.*\*/:\*/:
33 }}" \
34 $filelist