summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-09-10 11:19:01 +0200
committerLubomir Rintel <lkundrak@v3.sk>2019-09-10 11:19:56 +0200
commit24028a22467275671df71cc6a8054036b37d8f03 (patch)
tree046d175593e484ac1a7b82e4c1bae585c5de3a61 /contrib
parente4784327c0f1da74a78428b07d29c74bf6fa5a53 (diff)
downloadNetworkManager-24028a22467275671df71cc6a8054036b37d8f03.tar.gz
all: SPDX header conversion
$ find * -type f |xargs perl contrib/scripts/spdx.pl $ git rm contrib/scripts/spdx.pl
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/scripts/checkpatch.pl15
-rwxr-xr-xcontrib/scripts/nm-import-openconnect15
-rwxr-xr-xcontrib/scripts/nm-import-openvpn15
-rwxr-xr-xcontrib/scripts/nm-import-vpnc15
-rwxr-xr-xcontrib/scripts/spdx.pl105
-rwxr-xr-xcontrib/test/modemu.pl15
6 files changed, 5 insertions, 175 deletions
diff --git a/contrib/scripts/checkpatch.pl b/contrib/scripts/checkpatch.pl
index b5af6dfc2f..34c4f91ed3 100755
--- a/contrib/scripts/checkpatch.pl
+++ b/contrib/scripts/checkpatch.pl
@@ -1,19 +1,6 @@
#!/usr/bin/perl -n
+# SPDX-License-Identifier: GPL-2.0+
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
# Copyright 2018 Red Hat, Inc.
# $ perldoc checkpatch.pl for eye-pleasing view of the manual:
diff --git a/contrib/scripts/nm-import-openconnect b/contrib/scripts/nm-import-openconnect
index 1a99a2778c..36e4a35e1a 100755
--- a/contrib/scripts/nm-import-openconnect
+++ b/contrib/scripts/nm-import-openconnect
@@ -1,18 +1,5 @@
#!/usr/bin/env lua
---
--- This program is free software; you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License along
--- with this program; if not, write to the Free Software Foundation, Inc.,
--- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+-- SPDX-License-Identifier: GPL-2.0+
--
-- Copyright 2015 Red Hat, Inc.
--
diff --git a/contrib/scripts/nm-import-openvpn b/contrib/scripts/nm-import-openvpn
index 0ae4eff152..fa1bade007 100755
--- a/contrib/scripts/nm-import-openvpn
+++ b/contrib/scripts/nm-import-openvpn
@@ -1,18 +1,5 @@
#!/usr/bin/env lua
---
--- This program is free software; you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License along
--- with this program; if not, write to the Free Software Foundation, Inc.,
--- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+-- SPDX-License-Identifier: GPL-2.0+
--
-- Copyright 2015 Red Hat, Inc.
--
diff --git a/contrib/scripts/nm-import-vpnc b/contrib/scripts/nm-import-vpnc
index f194809d9c..50c08ca610 100755
--- a/contrib/scripts/nm-import-vpnc
+++ b/contrib/scripts/nm-import-vpnc
@@ -1,18 +1,5 @@
#!/usr/bin/env lua
---
--- This program is free software; you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License along
--- with this program; if not, write to the Free Software Foundation, Inc.,
--- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+-- SPDX-License-Identifier: GPL-2.0+
--
-- Copyright 2015 Red Hat, Inc.
--
diff --git a/contrib/scripts/spdx.pl b/contrib/scripts/spdx.pl
deleted file mode 100755
index d5541e893d..0000000000
--- a/contrib/scripts/spdx.pl
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/usr/bin/perl
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (C) 2019 Lubomir Rintel
-
-use strict;
-use warnings;
-
-sub escape
-{
- $_ = shift;
- s/\s+$//g;
- # Don't ask me
- s/\s+/[\\\/\\s\\*#-]\*/g;
- # I have no idea
- return "\\s*$_([\\s\\*]*\\*|[\\s-]*-|[\\s#]*#)";
- # Sorry
-}
-
-my $GPL2 = escape <<'EOL';
-This (program )?is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2( of the License)?, or
-\(at your option\) any later version.
-EOL
-
-my $LGPL2 = escape <<'EOL';
-This (library|program) is free software; you can redistribute it and/or
-modify it under the terms of the GNU (Lesser|Library) General Public
-License as published by the Free Software Foundation; either
-version 2 of the License, or \(at your option\) any later version.
-EOL
-
-my $WARRANTY1 = escape <<'EOL';
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-EOL
-
-my $TAIL1 = escape <<'EOL';
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-EOL
-
-my $TAIL2 = escape <<'EOL';
-You should have received a copy of the GNU (Lesser )?General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-EOL
-
-my $TAIL3 = escape <<'EOL';
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-EOL
-
-my $TAIL4 = escape <<'EOL';
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301 USA.
-EOL
-
-foreach my $filename (@ARGV) {
- next if $filename =~ /\.xml$/
- or $filename =~ /\bm4\//
- or $filename =~ /\bCOPYING/;
- next if $filename =~ /\b(src|shared)\/systemd\//
- and not $filename =~ /\/sd-adapt\//
- and not $filename =~ /\/nm-/;
- next if $filename =~ /\/(n-acd|c-list|c-rbtree|c-stdaux|c-siphash|n-dhcp4)\//;
-
- open (my $file, '<', $filename) or die "$filename: $!";
- my $content = join '', <$file>;
- my $spdx = '';
-
- if ($content =~ s/$GPL2//g) {
- $spdx = 'SPDX-License-Identifier: GPL-2.0+';
- } elsif ($content =~ s/$LGPL2//g) {
- $spdx = 'SPDX-License-Identifier: LGPL-2.1+';
- } else {
- warn $filename;
- }
- $content =~ s/$WARRANTY1//g;
- $content =~ s/$TAIL1//g;
- $content =~ s/$TAIL2//g;
- $content =~ s/$TAIL3//g;
- $content =~ s/$TAIL4//g;
- if ($spdx) {
- if ($content =~ /^(#![^\n]+[\/ ](perl|python|ruby|sh)[^\n]*\n)(.*)/s) {
- $content = "$1# $spdx\n$3";
- } elsif ($content =~ /^(#![^\n]+lua[^\n]*\n)(.*)/s) {
- $content = "$1-- $spdx\n$2";
- } elsif ($content =~ /^(#![^\n]+gjs[^\n]*\n)(.*)/s) {
- $content = "$1// $spdx\n$2";
- } elsif ($filename =~ /\.(h|c|cpp)(\.in)?$/) {
- $content = "// $spdx\n$content";
- } else {
- die $filename;
- }
- }
- open ($file, '>', $filename) or die "$filename: $!";
- print $file $content;
-}
diff --git a/contrib/test/modemu.pl b/contrib/test/modemu.pl
index 7704bf00c2..4b8822181b 100755
--- a/contrib/test/modemu.pl
+++ b/contrib/test/modemu.pl
@@ -1,19 +1,6 @@
#!/usr/bin/env perl
+# SPDX-License-Identifier: GPL-2.0+
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
# Copyright 2018 Red Hat, Inc.
# $ perldoc modemu.pl for eye-pleasing view of the manual: