From c9ddad07d75cc13a57bca2273928a530d9c3261a Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Mon, 5 Jun 2023 21:14:32 +0200 Subject: [PATCH] Add GPL header to scripts This also adds a comment to the CONTRIBUTING guidelines Co-authored-by: pljones --- .github/autobuild/android.sh | 25 +++++++++++++++++ .github/autobuild/extractVersionChangelog.pl | 25 +++++++++++++++++ .github/autobuild/get_build_vars.py | 25 +++++++++++++++++ .github/autobuild/ios.sh | 25 +++++++++++++++++ .github/autobuild/linux_deb.sh | 25 +++++++++++++++++ .github/autobuild/mac.sh | 25 +++++++++++++++++ .github/autobuild/windows.ps1 | 25 +++++++++++++++++ CONTRIBUTING.md | 7 +++++ tools/changelog-helper.sh | 25 +++++++++++++++++ tools/check-wininstaller-translations.sh | 29 ++++++++++++++++++++ tools/checkkeys.pl | 24 ++++++++++++++++ tools/create-translation-issues.sh | 25 +++++++++++++++++ tools/generate_json_rpc_docs.py | 25 +++++++++++++++++ tools/qt5_to_qt6_country_code_table.py | 25 +++++++++++++++++ tools/update-copyright-notices.sh | 29 ++++++++++++++++++-- 15 files changed, 362 insertions(+), 2 deletions(-) diff --git a/.github/autobuild/android.sh b/.github/autobuild/android.sh index 66744441d9..8e9a9d9cf0 100755 --- a/.github/autobuild/android.sh +++ b/.github/autobuild/android.sh @@ -1,4 +1,29 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2022-2023 +# +# Author(s): +# Christian Hoffmann +# The Jamulus Development Team +# +############################################################################## +# +# 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 +# +############################################################################## + set -eu # Some of the following version pinnings are semi-automatically checked for diff --git a/.github/autobuild/extractVersionChangelog.pl b/.github/autobuild/extractVersionChangelog.pl index a866d48e2d..672d828941 100755 --- a/.github/autobuild/extractVersionChangelog.pl +++ b/.github/autobuild/extractVersionChangelog.pl @@ -1,4 +1,29 @@ #!/usr/bin/env perl +############################################################################## +# Copyright (c) 2021-2023 +# +# Author(s): +# ann0see +# Christian Hoffmann +# The Jamulus Development Team +# +############################################################################## +# +# 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 +# +############################################################################## use strict; use warnings; diff --git a/.github/autobuild/get_build_vars.py b/.github/autobuild/get_build_vars.py index 7987d71b2b..72533b7dca 100755 --- a/.github/autobuild/get_build_vars.py +++ b/.github/autobuild/get_build_vars.py @@ -1,4 +1,29 @@ #!/usr/bin/env python3 +############################################################################## +# Copyright (c) 2022-2023 +# +# Author(s): +# Christian Hoffmann +# The Jamulus Development Team +# +############################################################################## +# +# 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 +# +############################################################################## + """ This script is triggered from the GitHub Autobuild workflow. It analyzes Jamulus.pro and git push details (tag vs. branch, etc.) to decide diff --git a/.github/autobuild/ios.sh b/.github/autobuild/ios.sh index 3d96df84d3..aeeab73390 100755 --- a/.github/autobuild/ios.sh +++ b/.github/autobuild/ios.sh @@ -1,4 +1,29 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2022-2023 +# +# Author(s): +# Christian Hoffmann +# The Jamulus Development Team +# +############################################################################## +# +# 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 +# +############################################################################## + set -eu QT_DIR=/usr/local/opt/qt diff --git a/.github/autobuild/linux_deb.sh b/.github/autobuild/linux_deb.sh index 63d14bf93c..ae6774089c 100755 --- a/.github/autobuild/linux_deb.sh +++ b/.github/autobuild/linux_deb.sh @@ -1,4 +1,29 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2022-2023 +# +# Author(s): +# Christian Hoffmann +# The Jamulus Development Team +# +############################################################################## +# +# 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 +# +############################################################################## + set -eu if [[ ! ${JAMULUS_BUILD_VERSION:-} =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then diff --git a/.github/autobuild/mac.sh b/.github/autobuild/mac.sh index a125b98aa9..7282f61044 100755 --- a/.github/autobuild/mac.sh +++ b/.github/autobuild/mac.sh @@ -1,4 +1,29 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2022-2023 +# +# Author(s): +# Christian Hoffmann +# The Jamulus Development Team +# +############################################################################## +# +# 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 +# +############################################################################## + set -eu QT_DIR=/usr/local/opt/qt diff --git a/.github/autobuild/windows.ps1 b/.github/autobuild/windows.ps1 index 21a3629f96..db095f2c29 100644 --- a/.github/autobuild/windows.ps1 +++ b/.github/autobuild/windows.ps1 @@ -1,3 +1,28 @@ +############################################################################## +# Copyright (c) 2022-2023 +# +# Author(s): +# Christian Hoffmann +# The Jamulus Development Team +# +############################################################################## +# +# 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 +# +############################################################################## + # Steps for generating Windows artifacts via Github Actions # See README.md in this folder for details. # See windows/deploy_windows.ps1 for standalone builds. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dff34e60b8..c6ec8432bd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,6 +46,13 @@ Please install and use [pylint](https://pylint.org/) to scan any Python code. There is a configuration file that defines some overrides, and note the [Editorconfig file](.editorconfig) in the project too. +### Licensing + +If you add new (source code) files, please add a header with the license to the file. This clarifies how your work is licensed. Please use the same format as in e.g. the source files in the `src/` directory. A license header must include: + +* A Legal copyright line +* The Author(s)/Copyright holder(s) list +* A Declaration of the licence, indicating how to refer to the full text if not provided ### Supported platforms diff --git a/tools/changelog-helper.sh b/tools/changelog-helper.sh index 0d4f2ff78a..063578e23a 100755 --- a/tools/changelog-helper.sh +++ b/tools/changelog-helper.sh @@ -1,4 +1,29 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2022-2023 +# +# Author(s): +# Christian Hoffmann +# The Jamulus Development Team +# +############################################################################## +# +# 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 +# +############################################################################## + # Requirements: git, Github CLI (gh), jq set -eu -o pipefail diff --git a/tools/check-wininstaller-translations.sh b/tools/check-wininstaller-translations.sh index a190577d5e..21486ac15e 100755 --- a/tools/check-wininstaller-translations.sh +++ b/tools/check-wininstaller-translations.sh @@ -1,4 +1,33 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2021-2023 +# +# Author(s): +# Christian Hoffmann +# The Jamulus Development Team +# +############################################################################## +# +# 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 +# +############################################################################## + +# This script compares Windows installer translations with the English version, +# checks for consistency and common mistakes. +# This is helpful for reviewing installer translation PRs. + set -eu -o pipefail BASE_DIR=src/translation/wininstaller/ diff --git a/tools/checkkeys.pl b/tools/checkkeys.pl index 7fcdf9ca42..46263e6b4e 100755 --- a/tools/checkkeys.pl +++ b/tools/checkkeys.pl @@ -1,4 +1,28 @@ #!/usr/bin/perl +############################################################################## +# Copyright (c) 2021-2023 +# +# Author(s): +# Tony Mountifield +# The Jamulus Development Team +# +############################################################################## +# +# 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 +# +############################################################################## use open qw(:std :utf8); use XML::Simple qw(:strict); diff --git a/tools/create-translation-issues.sh b/tools/create-translation-issues.sh index bbed1026df..0527787972 100755 --- a/tools/create-translation-issues.sh +++ b/tools/create-translation-issues.sh @@ -1,4 +1,29 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2021-2023 +# +# Author(s): +# Christian Hoffmann +# The Jamulus Development Team +# +############################################################################## +# +# 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 +# +############################################################################## + # This script opens translation issues for all languages via the Github API. # The script is idempotent and can be run multiple times. It will not create # multiple issues if milestone and title remain the same. Instead, it will diff --git a/tools/generate_json_rpc_docs.py b/tools/generate_json_rpc_docs.py index 42ea437a62..70bf2ad141 100755 --- a/tools/generate_json_rpc_docs.py +++ b/tools/generate_json_rpc_docs.py @@ -1,4 +1,29 @@ #!/usr/bin/env python3 +############################################################################## +# Copyright (c) 2022-2023 +# +# Author(s): +# Christian Hoffmann +# The Jamulus Development Team +# +############################################################################## +# +# 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 +# +############################################################################## + """ Generates the JSON RPC documentation from the source code and writes it into ../docs/JSON-RPC.md. diff --git a/tools/qt5_to_qt6_country_code_table.py b/tools/qt5_to_qt6_country_code_table.py index f82169ce73..9549e9f1d2 100755 --- a/tools/qt5_to_qt6_country_code_table.py +++ b/tools/qt5_to_qt6_country_code_table.py @@ -1,4 +1,29 @@ #!/usr/bin/env python3 +############################################################################## +# Copyright (c) 2022-2023 +# +# Author(s): +# Christian Hoffmann +# The Jamulus Development Team +# +############################################################################## +# +# 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 +# +############################################################################## + """ Jamulus uses Qt5 QLocale::Country codes in its protocol. Qt6 changed those codes in an incompatible way. diff --git a/tools/update-copyright-notices.sh b/tools/update-copyright-notices.sh index 00cad8f198..fb42ea2035 100755 --- a/tools/update-copyright-notices.sh +++ b/tools/update-copyright-notices.sh @@ -1,4 +1,29 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2022-2023 +# +# Author(s): +# Christian Hoffmann +# The Jamulus Development Team +# +############################################################################## +# +# 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 +# +############################################################################## + set -eu -o pipefail YEAR=$(date +%Y) @@ -6,8 +31,8 @@ echo "Updating global copyright strings..." sed -re 's/(Copyright.*2[0-9]{3}-)[0-9]{4}/\1'"${YEAR}"'/g' -i src/translation/*.ts src/util.cpp src/aboutdlgbase.ui echo "Updating copyright comment headers..." -find android ios linux mac src windows -regex '.*\.\(cpp\|h\|mm\)' -not -regex '\./\(\.git\|libs/\|moc_\|ui_\).*' | while read -r file; do - sed -re 's/(\*.*Copyright.*[^-][0-9]{4})(\s*-\s*\b[0-9]{4})?\s*$/\1-'"${YEAR}"'/' -i "${file}" +find android ios linux mac src windows tools .github -regex '.*\.\(cpp\|h\|mm\|sh\|py\|pl\)' -not -regex '\./\(\.git\|libs/\|moc_\|ui_\).*' | while read -r file; do + sed -re 's/((\*|#).*Copyright.*[^-][0-9]{4})(\s*-\s*\b[0-9]{4})?\s*$/\1-'"${YEAR}"'/' -i "${file}" done sed -re 's/^( [0-9]{4}-)[0-9]{4}( The Jamulus)/\1'"${YEAR}"'\2/' -i linux/debian/copyright