From 75f335ee5f567ce75df6e9c1ad3da1dc78a17c63 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Tue, 24 Oct 2023 16:03:36 +0200 Subject: [PATCH] website-build: Add Savannah CVS constraint. Most GNU projects use a CVS repository to publish their web pages. For some reasons, in the CVS root directory (inside the gnuboot CVS module) the only file that we can add is index.html. Subdirectories don't have this limitation. So we add a test for that. In addition when the website will be ready we will most likely have an html file that redirect to a subdirectory (like /web/) and so we add the html file for doing that too. Signed-off-by: Denis 'GNUtoo' Carikli Acked-by: Adrien 'neox' Bourmault --- website-build/check.sh | 18 ++++++++++++++++++ website-build/test/index.html | 6 ++++++ 2 files changed, 24 insertions(+) create mode 100644 website-build/test/index.html diff --git a/website-build/check.sh b/website-build/check.sh index 167fc01..c581646 100755 --- a/website-build/check.sh +++ b/website-build/check.sh @@ -48,10 +48,28 @@ test_pattern() fi } +test_savannah_cvs_constraints() +{ + name="$1" + tarball="$2" + + nr_files=$(tar tf "${tarball}" | grep -v '/' | wc -l) + + if [ ${nr_files} -eq 1 ] ; then + echo "[ OK ] ${name}" + else + echo "[ !! ] ${name} failed" + exit 1 + fi +} + + run_tests() { test_pattern "html test" "${tarball}" '\.html$' test_pattern "jpg test" "${tarball}" '\.jpg$' + test_savannah_cvs_constraints "Savannah CVS: Only /index.html in root directory" \ + "${tarball}" } if [ $# -eq 1 ] && [ "$1" = "-h" -o "$1" == "--help" ] ; then diff --git a/website-build/test/index.html b/website-build/test/index.html new file mode 100644 index 0000000..49dd0c0 --- /dev/null +++ b/website-build/test/index.html @@ -0,0 +1,6 @@ + + + + + +