diff options
author | Thomas Haller <thaller@redhat.com> | 2020-04-16 10:29:44 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-04-16 10:54:48 (GMT) |
commit | 503aa5e026a60d217ce389b857ce136748bd55f1 (patch) | |
tree | be6257e2b62d29d863f4f73f8e09c25d2e58c8b0 /lib/cli | |
parent | 4333aef8cbed802d099bbab02ff5cbca0d1f2eb4 (diff) | |
download | libnl-503aa5e026a60d217ce389b857ce136748bd55f1.zip libnl-503aa5e026a60d217ce389b857ce136748bd55f1.tar.gz libnl-503aa5e026a60d217ce389b857ce136748bd55f1.tar.bz2 |
license: fix and add SPDX license identifiers and drop license comments
This also fixes a few wrong SPDX license identifiers, where the original
license comment indicates GPL-2.0-only.
This is not done manually, but by running the following script:
---
#!/bin/bash
# Tool to drop license comments, adding SPDX license identifiers, while preserving
# copyright comments. The point is not to manually do this task, but perform some
# hacked up string replacement.
_cp() {
/bin/cp "$@"
}
_cat() {
/bin/cat "$@"
}
in_file() {
local T=$(mktemp)
_cp -f "$1" "$T"
_cat "$T"
rm -f "$T"
}
out_file() {
local T=$(mktemp)
_cat - > "$T"
_cp -f "$T" "$1"
rm -f "$T"
}
join() {
_cat "$@" | awk '{ printf("%s#x#", $0)}'
}
unjoin() {
_cat - | sed 's/#x#/\n/g'
}
files_all() {
git ls-files |
grep -v '\.png$' |
grep -v '^include/linux-private/'
}
adjust() {
NEWLINES='\(#x#\)\+'
COPYRIGHTS='\(\( \* Copyright (c) 20..\(-20..\|, 20..\)\? [^#]\+#x#\)\+\( \*#x# \* \(Stolen[^#]*\|Based on [^#]*\)#x#\)\?\)'
_cat - |
\
sed '1s%^\(/\* SPDX-License-Identifier: LGPL-2.1-only \*/\|\)#x#/\*#x# \* [^#]*#x# \*#x# \*[ ]\+This library is free software; you can redistribute it and/or#x# \*[ ]\+modify it under the terms of the GNU Lesser General Public#x# \*[ ]\+License as published by the Free Software Foundation version 2.1#x# \*[ ]\+of the License.#x# \*#x#'"$COPYRIGHTS"' \*/'"$NEWLINES"'%/\* SPDX-License-Identifier: LGPL-2.1-only \*/#x#/*#x#\2 */#x##x#%' |
\
sed '1s%^/\*#x# \* [^#]*#x# \*#x# \*[ ]\+This library is free software; you can redistribute it and/or#x# \*[ ]\+modify it under the terms of the GNU Lesser General Public#x# \*[ ]\+License as published by the Free Software Foundation version 2.1#x# \*[ ]\+of the License.#x# \*/'"$NEWLINES"'%/\* SPDX-License-Identifier: LGPL-2.1-only \*/#x##x#%' |
\
sed '1s%^\(\)/\*#x# \* [^#]*#x# \*#x# \*[ ]\+This library is free software; you can redistribute it and/or#x# \*[ ]\+modify it under the terms of the GNU Lesser General Public#x# \*[ ]\+License as published by the Free Software Foundation version 2.1#x# \*[ ]\+of the License.#x# \*#x#'"$COPYRIGHTS"' \*/'"$NEWLINES"'%/\* SPDX-License-Identifier: LGPL-2.1-only \*/#x#/*#x#\2 */#x##x#%' |
\
sed '1s%^\(/\* SPDX-License-Identifier: LGPL-2.1-only \*/\|\)#x#/\*#x# \* [^#]*#x# \*#x# \*[ ]\+This library is free software; you can redistribute it and/or#x# \*[ ]\+modify it under the terms of the GNU General Public License as#x# \*[ ]\+published by the Free Software Foundation version 2 of the License.#x# \*#x#'"$COPYRIGHTS"' \*/'"$NEWLINES"'%/\* SPDX-License-Identifier: GPL-2.0-only \*/#x#/*#x#\2 */#x##x#%'
}
FILES=( $(files_all) )
for f in "${FILES[@]}"; do
echo "processing \"$f\"..."
in_file "$f" | join | adjust | unjoin | out_file "$f"
done
Diffstat (limited to 'lib/cli')
-rw-r--r-- | lib/cli/cls/basic.c | 8 | ||||
-rw-r--r-- | lib/cli/cls/cgroup.c | 8 | ||||
-rw-r--r-- | lib/cli/qdisc/bfifo.c | 8 | ||||
-rw-r--r-- | lib/cli/qdisc/blackhole.c | 8 | ||||
-rw-r--r-- | lib/cli/qdisc/fq_codel.c | 8 | ||||
-rw-r--r-- | lib/cli/qdisc/hfsc.c | 8 | ||||
-rw-r--r-- | lib/cli/qdisc/htb.c | 8 | ||||
-rw-r--r-- | lib/cli/qdisc/ingress.c | 9 | ||||
-rw-r--r-- | lib/cli/qdisc/pfifo.c | 9 | ||||
-rw-r--r-- | lib/cli/qdisc/plug.c | 9 |
10 files changed, 10 insertions, 73 deletions
diff --git a/lib/cli/cls/basic.c b/lib/cli/cls/basic.c index 1a6b188..90ef554 100644 --- a/lib/cli/cls/basic.c +++ b/lib/cli/cls/basic.c @@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/cli/cls/basic.c basic classifier module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch> */ diff --git a/lib/cli/cls/cgroup.c b/lib/cli/cls/cgroup.c index 9e1443c..43536b5 100644 --- a/lib/cli/cls/cgroup.c +++ b/lib/cli/cls/cgroup.c @@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/cli/cls/cgroup.c cgroup classifier module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch> */ diff --git a/lib/cli/qdisc/bfifo.c b/lib/cli/qdisc/bfifo.c index 6b0206f..7e53541 100644 --- a/lib/cli/qdisc/bfifo.c +++ b/lib/cli/qdisc/bfifo.c @@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/bfifo.c bfifo module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch> */ diff --git a/lib/cli/qdisc/blackhole.c b/lib/cli/qdisc/blackhole.c index 372855f..2425ab7 100644 --- a/lib/cli/qdisc/blackhole.c +++ b/lib/cli/qdisc/blackhole.c @@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/blackhole.c Blackhole module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch> */ diff --git a/lib/cli/qdisc/fq_codel.c b/lib/cli/qdisc/fq_codel.c index a592f90..90e609e 100644 --- a/lib/cli/qdisc/fq_codel.c +++ b/lib/cli/qdisc/fq_codel.c @@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/cli/qdisc/fq_codel.c fq_codel module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com> */ diff --git a/lib/cli/qdisc/hfsc.c b/lib/cli/qdisc/hfsc.c index 619befc..cbbc100 100644 --- a/lib/cli/qdisc/hfsc.c +++ b/lib/cli/qdisc/hfsc.c @@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/cli/qdisc/hfsc.c HFSC module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Cong Wang <xiyou.wangcong@gmail.com> */ diff --git a/lib/cli/qdisc/htb.c b/lib/cli/qdisc/htb.c index 628e6cc..235701c 100644 --- a/lib/cli/qdisc/htb.c +++ b/lib/cli/qdisc/htb.c @@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/htb.c HTB module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch> */ diff --git a/lib/cli/qdisc/ingress.c b/lib/cli/qdisc/ingress.c index 8892a64..3c2a6c0 100644 --- a/lib/cli/qdisc/ingress.c +++ b/lib/cli/qdisc/ingress.c @@ -1,12 +1,5 @@ - +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/ingress.c ingress module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com> */ diff --git a/lib/cli/qdisc/pfifo.c b/lib/cli/qdisc/pfifo.c index 7aac7df..fbda6eb 100644 --- a/lib/cli/qdisc/pfifo.c +++ b/lib/cli/qdisc/pfifo.c @@ -1,12 +1,5 @@ - +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/pfifo.c pfifo module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch> */ diff --git a/lib/cli/qdisc/plug.c b/lib/cli/qdisc/plug.c index 227082d..549db0b 100644 --- a/lib/cli/qdisc/plug.c +++ b/lib/cli/qdisc/plug.c @@ -1,12 +1,5 @@ - +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/cli/qdisc/plug.c plug module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2012 Shriram Rajagopalan <rshriram@cs.ubc.ca> */ |