X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=brc2;fp=brc2;h=3f953c1dc8c001b4bc110b9ebfc554efbb352066;hp=a13574b8bccc7d6070dbe64acc3866c299fc797a;hb=50f25d1eec109c4596cfc638c9a7c98da0f0b5d0;hpb=07fbcf11a78d2ee20697eb98f5b7eeaa2475f1d1 diff --git a/brc2 b/brc2 index a13574b..3f953c1 100644 --- a/brc2 +++ b/brc2 @@ -1,6 +1,25 @@ #!/bin/bash -# Copyright (C) 2019 Ian Kelling -# SPDX-License-Identifier: AGPL-3.0-or-later +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # this gets sourced. shebang is just for file mode detection @@ -1975,18 +1994,24 @@ capache() fi } -# wip + + + + apache-apply() { for file; do if head -n1 "$file"| grep -E '^#!/bin/bash\b' &>/dev/null; then { head -n1 "$file" + # First paragraph is to avoid people being confused about why a + # file is apache licensed. cat <<'EOF' -# I follow the GNU license recommendations, -# https://www.gnu.org/licenses/license-recommendations.en.html, which -# recommends that small programs, < 300 lines, such those contained in -# this file or related to this file, be licensed Apache License 2.0. Any -# program which grows large enough, I will switch it to GPL. +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. # Copyright 2024 Ian Kelling @@ -2008,6 +2033,9 @@ EOF fi done } +apache-strip() { + for f in $(find . -type f -maxdepth 1); do if head -n1 "$f"| grep -E '^#!/bin/bash\b' &>/dev/null; then { head -n 20 $f | tac | sed '/^# limitations under the License.$/,/^# Copyright.*Ian Kelling$/d' | tac; tail -n+21 $f; } |sponge $f; fi ; done + } chrome() { if type -p chromium &>/dev/null; then