From b1b7d1d4e76ab3d1c908be0eef02bb34d5f158d8 Mon Sep 17 00:00:00 2001 From: mars Date: Sat, 26 Nov 2022 21:53:03 -0700 Subject: [PATCH 1/8] Fix check_licenses.sh tomcat error failure --- check_licenses.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/check_licenses.sh b/check_licenses.sh index aad8cd3..9dc761d 100755 --- a/check_licenses.sh +++ b/check_licenses.sh @@ -12,16 +12,17 @@ dir="$(pwd | sed 's/\//\n/g' | tail -n 1)" for toml in $(find "$PWD" -name "Cargo.toml"); do printf "Project: %s\n" "$(tomcat package.name "$toml")" + + if [ "$(toml_lic="$(tomcat package.license "$toml" && printf "%s\n" "$?")")" = "0" ]; then + printf "%s: Missing license information\n" "$(printf "%s\n" "$toml" |\ + sed "s/^.\+$dir\///g")" + continue + fi + for file in $(find "$(printf "%s\n" "$toml" |\ sed 's/Cargo\.toml/src/g')" -name "*.rs") do info="$(head -n 2 "$file")" - toml_lic="$(tomcat package.license "$toml")" - if ! test -n "$toml_lic"; then - printf "%s: Missing license information\n" "$(printf "%s\n" "$toml" |\ - sed "s/^.\+$dir\///g")" - continue 2 - fi if ! [ "$toml_lic" = "$(printf "%s\n" "$info" | tail -n 1 |\ sed -n 's/\/\/ SPDX-License-Identifier: //p')" ] then From b774115d207bf1a5e3182e08e16f02a49c798604 Mon Sep 17 00:00:00 2001 From: mars Date: Sat, 26 Nov 2022 22:03:51 -0700 Subject: [PATCH 2/8] Hacky e-flag manipulation to catch tomcat errors --- check_licenses.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/check_licenses.sh b/check_licenses.sh index 9dc761d..f06bcd6 100755 --- a/check_licenses.sh +++ b/check_licenses.sh @@ -13,11 +13,14 @@ dir="$(pwd | sed 's/\//\n/g' | tail -n 1)" for toml in $(find "$PWD" -name "Cargo.toml"); do printf "Project: %s\n" "$(tomcat package.name "$toml")" - if [ "$(toml_lic="$(tomcat package.license "$toml" && printf "%s\n" "$?")")" = "0" ]; then + set +e # disable error propogation to catch tomcat exit code + toml_lic="$(tomcat package.license "$toml")" + if ! [ "$?" = "0" ]; then printf "%s: Missing license information\n" "$(printf "%s\n" "$toml" |\ sed "s/^.\+$dir\///g")" continue fi + set -e # re-enable error propogation for the rest of the script for file in $(find "$(printf "%s\n" "$toml" |\ sed 's/Cargo\.toml/src/g')" -name "*.rs") From b0c29818eef5ec400ffc10a23b59f6b7d8e40927 Mon Sep 17 00:00:00 2001 From: mars Date: Sat, 26 Nov 2022 22:06:09 -0700 Subject: [PATCH 3/8] Add AGPL license to magpie Cargo.toml --- apps/magpie/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/magpie/Cargo.toml b/apps/magpie/Cargo.toml index 1dcb110..37e72e8 100644 --- a/apps/magpie/Cargo.toml +++ b/apps/magpie/Cargo.toml @@ -2,6 +2,7 @@ name = "canary-magpie" version = "0.1.0" edition = "2021" +license = "AGPL-3.0-or-later" [[bin]] name = "magpie" From 6054949694ebed754aae8d8fa9dbf2fec7ff7c3c Mon Sep 17 00:00:00 2001 From: mars Date: Sat, 26 Nov 2022 22:06:21 -0700 Subject: [PATCH 4/8] Add license header to music-player mpris.rs --- apps/music-player/src/mpris.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/music-player/src/mpris.rs b/apps/music-player/src/mpris.rs index 4cf2b4b..fb06bf0 100644 --- a/apps/music-player/src/mpris.rs +++ b/apps/music-player/src/mpris.rs @@ -1,3 +1,6 @@ +// Copyright (c) 2022 Marceline Cramer +// SPDX-License-Identifier: AGPL-3.0-or-later + use std::collections::HashMap; use zbus::fdo::DBusProxy; From 734ad8d6306be32973d4b76f24ff9d7c6d746678 Mon Sep 17 00:00:00 2001 From: mars Date: Sat, 26 Nov 2022 22:06:39 -0700 Subject: [PATCH 5/8] Add missing license headers to SAO UI sources --- scripts/sao-ui/src/music_player.rs | 3 +++ scripts/sao-ui/src/style.rs | 3 +++ scripts/sao-ui/src/widgets/palette.rs | 3 +++ scripts/sao-ui/src/widgets/slider.rs | 3 +++ 4 files changed, 12 insertions(+) diff --git a/scripts/sao-ui/src/music_player.rs b/scripts/sao-ui/src/music_player.rs index ab05398..9be32f0 100644 --- a/scripts/sao-ui/src/music_player.rs +++ b/scripts/sao-ui/src/music_player.rs @@ -1,3 +1,6 @@ +// Copyright (c) 2022 Marceline Crmaer +// SPDX-License-Identifier: AGPL-3.0-or-later + use api::*; use canary_script::*; diff --git a/scripts/sao-ui/src/style.rs b/scripts/sao-ui/src/style.rs index 2f383f0..0d5c2ff 100644 --- a/scripts/sao-ui/src/style.rs +++ b/scripts/sao-ui/src/style.rs @@ -1,3 +1,6 @@ +// Copyright (c) 2022 Marceline Crmaer +// SPDX-License-Identifier: AGPL-3.0-or-later + use canary_script::Color; /// A reusable set of colors. Used by default widget styles. diff --git a/scripts/sao-ui/src/widgets/palette.rs b/scripts/sao-ui/src/widgets/palette.rs index d045feb..82652eb 100644 --- a/scripts/sao-ui/src/widgets/palette.rs +++ b/scripts/sao-ui/src/widgets/palette.rs @@ -1,3 +1,6 @@ +// Copyright (c) 2022 Marceline Crmaer +// SPDX-License-Identifier: AGPL-3.0-or-later + use super::prelude::*; use shell::Offset; use text::{HorizontalAlignment, Label, LabelText}; diff --git a/scripts/sao-ui/src/widgets/slider.rs b/scripts/sao-ui/src/widgets/slider.rs index 5a8cd20..509681a 100644 --- a/scripts/sao-ui/src/widgets/slider.rs +++ b/scripts/sao-ui/src/widgets/slider.rs @@ -1,3 +1,6 @@ +// Copyright (c) 2022 Marceline Crmaer +// SPDX-License-Identifier: AGPL-3.0-or-later + use super::prelude::*; pub struct SliderStyle { From 01a37153af01496392ed37743c85e177112a1613 Mon Sep 17 00:00:00 2001 From: mars Date: Sat, 26 Nov 2022 22:14:34 -0700 Subject: [PATCH 6/8] Revert "Hacky e-flag manipulation to catch tomcat errors" This reverts commit b774115d207bf1a5e3182e08e16f02a49c798604. --- check_licenses.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/check_licenses.sh b/check_licenses.sh index f06bcd6..9dc761d 100755 --- a/check_licenses.sh +++ b/check_licenses.sh @@ -13,14 +13,11 @@ dir="$(pwd | sed 's/\//\n/g' | tail -n 1)" for toml in $(find "$PWD" -name "Cargo.toml"); do printf "Project: %s\n" "$(tomcat package.name "$toml")" - set +e # disable error propogation to catch tomcat exit code - toml_lic="$(tomcat package.license "$toml")" - if ! [ "$?" = "0" ]; then + if [ "$(toml_lic="$(tomcat package.license "$toml" && printf "%s\n" "$?")")" = "0" ]; then printf "%s: Missing license information\n" "$(printf "%s\n" "$toml" |\ sed "s/^.\+$dir\///g")" continue fi - set -e # re-enable error propogation for the rest of the script for file in $(find "$(printf "%s\n" "$toml" |\ sed 's/Cargo\.toml/src/g')" -name "*.rs") From 89470414179a5374ec3184e6a2ee7146ab5abe3f Mon Sep 17 00:00:00 2001 From: mars Date: Sat, 26 Nov 2022 22:14:48 -0700 Subject: [PATCH 7/8] Revert "Fix check_licenses.sh tomcat error failure" This reverts commit b1b7d1d4e76ab3d1c908be0eef02bb34d5f158d8. --- check_licenses.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/check_licenses.sh b/check_licenses.sh index 9dc761d..aad8cd3 100755 --- a/check_licenses.sh +++ b/check_licenses.sh @@ -12,17 +12,16 @@ dir="$(pwd | sed 's/\//\n/g' | tail -n 1)" for toml in $(find "$PWD" -name "Cargo.toml"); do printf "Project: %s\n" "$(tomcat package.name "$toml")" - - if [ "$(toml_lic="$(tomcat package.license "$toml" && printf "%s\n" "$?")")" = "0" ]; then - printf "%s: Missing license information\n" "$(printf "%s\n" "$toml" |\ - sed "s/^.\+$dir\///g")" - continue - fi - for file in $(find "$(printf "%s\n" "$toml" |\ sed 's/Cargo\.toml/src/g')" -name "*.rs") do info="$(head -n 2 "$file")" + toml_lic="$(tomcat package.license "$toml")" + if ! test -n "$toml_lic"; then + printf "%s: Missing license information\n" "$(printf "%s\n" "$toml" |\ + sed "s/^.\+$dir\///g")" + continue 2 + fi if ! [ "$toml_lic" = "$(printf "%s\n" "$info" | tail -n 1 |\ sed -n 's/\/\/ SPDX-License-Identifier: //p')" ] then From f8965b802ca26ce268e1aaa96bf0dbe361348f13 Mon Sep 17 00:00:00 2001 From: mars Date: Sat, 26 Nov 2022 22:16:12 -0700 Subject: [PATCH 8/8] Move check_licenses.sh license fetch outside of src/ loop --- check_licenses.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/check_licenses.sh b/check_licenses.sh index aad8cd3..19da131 100755 --- a/check_licenses.sh +++ b/check_licenses.sh @@ -12,16 +12,16 @@ dir="$(pwd | sed 's/\//\n/g' | tail -n 1)" for toml in $(find "$PWD" -name "Cargo.toml"); do printf "Project: %s\n" "$(tomcat package.name "$toml")" + toml_lic="$(tomcat package.license "$toml")" + if ! test -n "$toml_lic"; then + printf "%s: Missing license information\n" "$(printf "%s\n" "$toml" |\ + sed "s/^.\+$dir\///g")" + continue 2 + fi for file in $(find "$(printf "%s\n" "$toml" |\ sed 's/Cargo\.toml/src/g')" -name "*.rs") do info="$(head -n 2 "$file")" - toml_lic="$(tomcat package.license "$toml")" - if ! test -n "$toml_lic"; then - printf "%s: Missing license information\n" "$(printf "%s\n" "$toml" |\ - sed "s/^.\+$dir\///g")" - continue 2 - fi if ! [ "$toml_lic" = "$(printf "%s\n" "$info" | tail -n 1 |\ sed -n 's/\/\/ SPDX-License-Identifier: //p')" ] then