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 <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2023-10-24 16:03:36 +02:00 committed by Adrien 'neox' Bourmault
parent c007ab227d
commit 75f335ee5f
Signed by: neox
GPG Key ID: 2974E1D5F25DFCC8
2 changed files with 24 additions and 0 deletions

View File

@ -48,10 +48,28 @@ test_pattern()
fi 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() run_tests()
{ {
test_pattern "html test" "${tarball}" '\.html$' test_pattern "html test" "${tarball}" '\.html$'
test_pattern "jpg test" "${tarball}" '\.jpg$' 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 if [ $# -eq 1 ] && [ "$1" = "-h" -o "$1" == "--help" ] ; then

View File

@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Refresh" content="0; url='https://gnu.org/software/gnuboot/test/web/'" />
</head>
</html>