From 980bcff084f37138585082868093248b48b2bb23 Mon Sep 17 00:00:00 2001 From: "Peter D. Barnes, Jr." Date: Wed, 1 Aug 2012 12:36:50 -0700 Subject: [PATCH] Detect doc builds for public site, ignore ns3_version.js auto-generated file. --- .hgignore | 2 ++ doc/ns3_html_theme/get_version.sh | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.hgignore b/.hgignore index d68a5518b..a6cc5fa01 100644 --- a/.hgignore +++ b/.hgignore @@ -37,3 +37,5 @@ massif.* \.diff$ \.tr$ \#[^\#/]+\#$ +syntax: glob +ns3_version.js \ No newline at end of file diff --git a/doc/ns3_html_theme/get_version.sh b/doc/ns3_html_theme/get_version.sh index 8c15a0bed..bdf237c30 100755 --- a/doc/ns3_html_theme/get_version.sh +++ b/doc/ns3_html_theme/get_version.sh @@ -86,16 +86,16 @@ HOST=`hostname` NSNAM="nsnam.ece.gatech.edu" # Build directory -DAILY="/tmp/daily_nsnam/.*" +DAILY="^/tmp/daily_nsnam/" if [ $nsnam -eq 1 ]; then HOST=$NSNAM OLDPWD=$PWD - PWD=/tmp/daily_nsnam/foo +# PWD=/tmp/daily_nsnam/foo say "forcing build for nsnam.org" fi -if [[ $HOST == $NSNAM && $PWD =~ $DAILY ]] ; then +if [[ ( $HOST == $NSNAM ) && ( $PWD =~ $DAILY ) ]] ; then PUBLIC=1 say "building public docs for nsnam.org" else @@ -158,11 +158,13 @@ fi # Copy to html directories # This seems not always done automatically -# by the Sphinx build +# by Sphinx when rebuilding cd doc 2>&1 >/dev/null for d in {manual,models,tutorial{,-pt-br}}/build/{single,}html/_static html \ html ; do - cp ns3_html_theme/static/ns3_version.js $d + # expect the copy to fail if the destination dir + # hasn't been created by a prior doc build + cp ns3_html_theme/static/ns3_version.js $d 2>/dev/null done cd - 2>&1 >/dev/null