Commit 7ec2b22d authored by Nathalie Furmento's avatar Nathalie Furmento

create redirect instead of modifying source files

parent 455b679e
Pipeline #159493 passed with stages
in 1 minute and 22 seconds
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<h3>Need any help?</h3> <h3>Need any help?</h3>
<p>For any questions regarding StarPU, you can <p>For any questions regarding StarPU, you can
<ul> <ul>
<li>Read the latest <a href="/files/testing/master/doc/html">documentation</a>, <li>Read the latest <a href="/files/testing/master/doc/html/">documentation</a>,
and more specifically the <a href="/files/testing/master/doc/html/FrequentlyAskedQuestions.html">FAQ</a>,</li> and more specifically the <a href="/files/testing/master/doc/html/FrequentlyAskedQuestions.html">FAQ</a>,</li>
<li>Read the <a href="/tutorials/">tutorials</a>,</li> <li>Read the <a href="/tutorials/">tutorials</a>,</li>
<li>Browse <li>Browse
......
...@@ -68,7 +68,7 @@ StarPU. ...@@ -68,7 +68,7 @@ StarPU.
</p> </p>
<p> <p>
The latest documentation in <a href="/files/testing/master/doc/starpu.pdf">PDF</a> The latest documentation in <a href="/files/testing/master/doc/starpu.pdf">PDF</a>
and <a href="/files/testing/master/doc/html">HTML</a> is updated everyday, but covers and <a href="/files/testing/master/doc/html/">HTML</a> is updated everyday, but covers
the latest developments which may not be available in the latest release. the latest developments which may not be available in the latest release.
</p> </p>
</div> </div>
......
...@@ -2,32 +2,55 @@ ...@@ -2,32 +2,55 @@
dir=$(dirname $0) dir=$(dirname $0)
createRedirect() createRedirectFile()
{ {
while read line src=$1
do dst=$2
src=$(echo $line | awk '{print $1}') (cat <<EOF
dst=$(echo $line | awk '{print $2}')
echo create redirect from $src to $dst
mkdir -p public/$src
(cat <<EOF
<head> <head>
<title>Page has moved!</title> <title>Page has moved!</title>
<meta http-equiv="Refresh" content="0; URL=$dst" /> <meta http-equiv="Refresh" content="0; URL=$dst" />
</head> </head>
EOF EOF
) > public/$src/index.html ) > public/$src
}
createRedirectDir()
{
src=$1
dst=$2
mkdir -p public/$src
createRedirectFile $src/index.html $dst
}
createRedirect()
{
while read line
do
src=$(echo $line | awk '{print $1}')
dst=$(echo $line | awk '{print $2}')
echo create redirect from $src to $dst
createRedirectDir $src $dst
done< $dir/redirect.txt done< $dir/redirect.txt
} }
updateFileLinks() updateFileLinks()
{ {
for f in $(grep -rsl 'href="/files' public) for x in $(grep -rs 'href="\/files/' public | tr ' ' '\012' | tr '\t' '\012' | grep href | sed -e 's/href="//' -e 's/".*//' -e 's/#.*//' | sort | uniq)
do do
echo update file links in $f echo "create redirect for $x"
sed -i 's/href="\/files/href="http:\/\/starpu.gforge.inria.fr\/files/g' $f case "$x" in
*/) createRedirectDir $x "http://starpu.gforge.inria.fr$x" ;;
*) mkdir -p public/$(dirname $x) && createRedirectFile $x "http://starpu.gforge.inria.fr$x" ;;
esac
done done
# for f in $(grep -rsl 'href="/files' public)
# do
# echo update file links in $f
# sed -i 's/href="\/files/href="http:\/\/starpu.gforge.inria.fr\/files/g' $f
# done
} }
rm -rf public rm -rf public
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment