changeset 45:6a072a24fed8

Test for some accompanying files
author Chris Cannam
date Thu, 07 Aug 2014 14:05:33 +0100
parents 0036098a5edb
children d572322e2efe
files SCRIPTS/process.sh
diffstat 1 files changed, 24 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/SCRIPTS/process.sh	Thu Aug 07 13:37:13 2014 +0100
+++ b/SCRIPTS/process.sh	Thu Aug 07 14:05:33 2014 +0100
@@ -438,7 +438,29 @@
 	    echo "NOTE: multiple .ttl or .n3 files found in $dir" | tee -a "$log"
 	fi
     done
-    if [ "$first" = "yes" ]; then good=no; fi
+    if [ "$first" = "yes" ]; then 
+	good=no; 
+    else
+	echo "GOOD: found one or more .ttl or .n3 files (we don't actually test their validity or content here though)" | tee -a "$log"
+    fi
+    [ "$good" = "yes" ]
+}
+
+env_test_accompaniments() {
+    dir="$1"
+    log=$(logfile_for envtest "$dir")
+    good=yes
+    if ! ls -1 "$dir" | egrep -qi "^readme(.txt|)$"; then
+	echo "ERROR: no README file found" | tee -a "$log"
+	good=no
+    fi
+    if ! ls -1 "$dir" | egrep -qi "^(copying|licen[cs]e)(.txt|)$"; then
+	echo "ERROR: no COPYING or LICEN[CS]E file found" | tee -a "$log"
+	good=no
+    fi
+    if ! ls -1 "$dir" | egrep -qi "^citation(.txt|)$"; then
+	echo "NOTE: no CITATION file found" | tee -a "$log"
+    fi
     [ "$good" = "yes" ]
 }
 
@@ -447,7 +469,7 @@
     log=$(logfile_for envtest "$dir")
     allgood=yes
     cat /dev/null > "$log"
-    for test in exports stdout cat ttl; do
+    for test in exports stdout cat ttl accompaniments; do
 	"env_test_$test" "$dir" || allgood=no
     done
     if [ "$allgood" != "yes" ]; then