Repository: hesa/foss-licenses (language: python)

Issue:
Missing file "disclamer.md"
Some of the JSON files refer to https://github.com/hesa/license-db/tree/main/var/disclamer.md, which does not exist. The correct file seems to be https://github.com/hesa/foss-licenses/blob/main/var/disclaimer.md

https://github.com/search?q=repo%3Ahesa%2Ffoss-licenses%20disclamer&type=code


Discussion / hints:
Thanks @stefan6419846 for noticing. Really embarrassing :(

I have  "some" licenses from pypi that I need to finish and merge. After that I will do this one.

Fix patch:
diff --git a/Makefile b/Makefile
index 9f2a54c..2ef0780 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,10 @@ check_license_files:
 	@echo -m "Sanity check the licenses: " ; \
 		./tests/shell/sanity-check.sh || exit 1; echo "OK"
 
+# Check disclaimers
+	@echo -m "Check the disclaimers: " ; \
+		./tests/shell/check-disclaimer.sh || exit 1; echo "OK"
+
 # check JSON file not being licenses
 	@for lf in `find var/  -maxdepth 1  -name "*.json" `; \
 		do \
diff --git a/var/ambiguities.json b/var/ambiguities.json
index 8d3875e..4e96cf7 100644
--- a/var/ambiguities.json
+++ b/var/ambiguities.json
@@ -1,6 +1,6 @@
 {
     "meta": {
-        "disclaimer": "https://github.com/hesa/license-db/tree/main/var/disclamer.md",
+        "disclaimer": "https://raw.githubusercontent.com/hesa/foss-licenses/main/var/disclaimer.md",
         "comment": ""
     },
     "ambiguities": {
diff --git a/var/compounds.json b/var/compounds.json
index bef9beb..6460c7d 100644
--- a/var/compounds.json
+++ b/var/compounds.json
@@ -1,6 +1,6 @@
 {
     "meta": {
-        "disclaimer": "https://github.com/hesa/license-db/tree/main/var/disclamer.md",
+        "disclaimer": "https://raw.githubusercontent.com/hesa/foss-licenses/main/var/disclaimer.md",
         "comment": ""
     },
     "compounds": [
diff --git a/var/duals.json b/var/duals.json
index 41d0b55..896c546 100644
--- a/var/duals.json
+++ b/var/duals.json
@@ -1,6 +1,6 @@
 {
     "meta": {
-        "disclaimer": "https://github.com/hesa/license-db/tree/main/var/disclamer.md",
+        "disclaimer": "https://raw.githubusercontent.com/hesa/foss-licenses/main/var/disclaimer.md",
         "comment": ""
     },
     "dual-licenses": [
diff --git a/var/operators.json b/var/operators.json
index 89f669b..23a0e0c 100644
--- a/var/operators.json
+++ b/var/operators.json
@@ -1,6 +1,6 @@
 {
     "meta": {
-        "disclaimer": "https://github.com/hesa/license-db/tree/main/var/disclamer.md",
+        "disclaimer": "https://raw.githubusercontent.com/hesa/foss-licenses/main/var/disclaimer.md",
 	"comment": "Operators (and mappings to SPDX) allowed"
     },
     "operators": {


Test patch:
diff --git a/tests/additional-licenses/mylicense.json b/tests/additional-licenses/mylicense.json
index 23d1637..0b3244f 100644
--- a/tests/additional-licenses/mylicense.json
+++ b/tests/additional-licenses/mylicense.json
@@ -1,6 +1,6 @@
 {
     "meta": {
-        "disclaimer": "",
+        "disclaimer": "This is TEST data. DO NOT USE",
 	"comment": ""
     },
     "spdxid": "LicenseRef-mycompany-mylicense",
diff --git a/tests/licenses/BSD-3-Clause.json b/tests/licenses/BSD-3-Clause.json
index 4c318f5..62bd380 100644
--- a/tests/licenses/BSD-3-Clause.json
+++ b/tests/licenses/BSD-3-Clause.json
@@ -1,6 +1,6 @@
 {
     "meta": {
-        "disclaimer": "bla bla ",
+        "disclaimer": "This is TEST data. DO NOT USE",
 	"comment": "Update meta information. Add alias (3-BSD)"
     },
     "spdxid": "BSD-3-Clause",
diff --git a/tests/licenses/GPL-2.0-or-later.json b/tests/licenses/GPL-2.0-or-later.json
index d3ffb07..3986884 100644
--- a/tests/licenses/GPL-2.0-or-later.json
+++ b/tests/licenses/GPL-2.0-or-later.json
@@ -1,6 +1,6 @@
 {
     "meta": {
-        "disclaimer": "bla bla ",
+        "disclaimer": "This is TEST data. DO NOT USE",
 	"comment": "adapting to new format"
     },
     "spdxid": "GPL-2.0-or-later",
diff --git a/tests/licenses/no-compat.json b/tests/licenses/no-compat.json
index 6c7dc57..e62ecb0 100644
--- a/tests/licenses/no-compat.json
+++ b/tests/licenses/no-compat.json
@@ -1,6 +1,6 @@
 {
     "meta": {
-        "disclaimer": "bla bla ",
+        "disclaimer": "This is TEST data. DO NOT USE",
 	"comment": "adapting to new format"
     },
     "spdxid": "LicenseRef-dummy-no-compat",
diff --git a/tests/licenses/x11-keith-packard.json b/tests/licenses/x11-keith-packard.json
index 51187f6..6c923c5 100644
--- a/tests/licenses/x11-keith-packard.json
+++ b/tests/licenses/x11-keith-packard.json
@@ -1,6 +1,6 @@
 {
     "meta": {
-        "disclaimer": "bla bla ",
+        "disclaimer": "This is TEST data. DO NOT USE",
 	"comment": "adapting to new format"
     },
     "spdxid": "LicenseRef-flict-keith-packard",
diff --git a/tests/shell/check-disclaimer.sh b/tests/shell/check-disclaimer.sh
new file mode 100755
index 0000000..7211ce3
--- /dev/null
+++ b/tests/shell/check-disclaimer.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+# SPDX-FileCopyrightText: 2024 Henrik Sandklef
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+PROD_DISCLAIMERS=$(find . -name "*.json" | xargs grep disclaimer | grep http | cut -d : -f 3-10 | sort  -u | wc -l)
+TEST_DISCLAIMERS=$(find . -name "*.json" | xargs grep disclaimer | grep test | cut -d : -f 3-10 | sort  -u | wc -l)
+
+
+EXIT_CODE=0
+if [ $PROD_DISCLAIMERS -ne 1 ]
+then
+    echo "Number of production disclaimers ($PROD_DISCLAIMERS) incorrect. Should be 1"
+    EXIT_CODE=1
+fi
+
+if [ $PROD_DISCLAIMERS -ne 1 ]
+then
+    echo "Number of production disclaimers ($PROD_DISCLAIMERS) incorrect. Should be 1"
+    EXIT_CODE=1
+fi
+
+
+EXPECTED="\"https://raw.githubusercontent.com/hesa/foss-licenses/main/var/disclaimer.md\""
+ACTUAL="$(find . -name "*.json" | xargs grep disclaimer | grep http | cut -d : -f 3-10 | head -1 | sed 's/[, ]*//g')"
+if [ "$EXPECTED" != "$ACTUAL" ]
+then
+    echo "Production disclaimer URL incorrect"
+    echo " * expected: $EXPECTED"
+    echo " * actual:   $ACTUAL"
+    
+    EXIT_CODE=1
+fi
+    
+EXPECTED="\"This is TEST data. DO NOT USE\""
+ACTUAL="$(find . -name "*.json" | xargs grep disclaimer | grep test | cut -d : -f 3-10 | head -1  | sed -e 's/^ //g' -e 's/,$//g')"
+if [ "$EXPECTED" != "$ACTUAL" ]
+then
+    echo "Test disclaimer URL incorrect"
+    echo " * expected: $EXPECTED"
+    echo " * actual:   $ACTUAL"
+    EXIT_CODE=1
+fi
+    
+if [ $EXIT_CODE -ne 0 ]
+then
+    echo " **********************************************"
+    echo " ******************* ERROR ********************"
+    echo " **********************************************"
+fi
+exit $EXIT_CODE
diff --git a/tests/var/compounds.json b/tests/var/compounds.json
index 079fa68..74a62e8 100644
--- a/tests/var/compounds.json
+++ b/tests/var/compounds.json
@@ -1,6 +1,6 @@
 {
     "meta": {
-        "disclaimer": "https://github.com/hesa/license-db/tree/main/var/disclamer.md",
+        "disclaimer": "This is TEST data. DO NOT USE",
         "comment": ""
     },
     "compounds": [
diff --git a/tests/var/duals.json b/tests/var/duals.json
index fcdfb3d..7e52c4d 100644
--- a/tests/var/duals.json
+++ b/tests/var/duals.json
@@ -1,6 +1,6 @@
 {
     "meta": {
-        "disclaimer": "https://github.com/hesa/license-db/tree/main/var/disclamer.md",
+        "disclaimer": "This is TEST data. DO NOT USE",
         "comment": ""
     },
     "dual-licenses": [