|
From: <ai...@us...> - 2008-09-21 18:38:45
|
Revision: 8791
http://plplot.svn.sourceforge.net/plplot/?rev=8791&view=rev
Author: airwin
Date: 2008-09-21 18:38:39 +0000 (Sun, 21 Sep 2008)
Log Message:
-----------
Preserve timestamps for cp of example source code to make subsequent rsync
step more efficient.
Demand WWW_USER, WWW_GROUP, WWW_HOST, and WWW_DIR be non-empty.
Tweak commentary.
Modified Paths:
--------------
trunk/scripts/htdocs-gen_plot-examples.sh
Modified: trunk/scripts/htdocs-gen_plot-examples.sh
===================================================================
--- trunk/scripts/htdocs-gen_plot-examples.sh 2008-09-21 18:27:24 UTC (rev 8790)
+++ trunk/scripts/htdocs-gen_plot-examples.sh 2008-09-21 18:38:39 UTC (rev 8791)
@@ -1,37 +1,64 @@
#! /bin/bash
-# This script is intended to generate a tarball of source code and screenshots,
+# This script generates a tarball of source code and screenshots,
# 'htdocs_plot_examples.tgz', that will be part of the 'examples' web page,
#
+# The original intention was to upload the generated tarball directly to the
+# PLplot SourceForge website filesystem and unpack it there using ssh
+# commands, but now that SF is no longer ssh accessible, the script
+# has been generalized for any ssh-accessible site, which in turn can
+# be used to update the SF website using rsync.
+
# This script must be run in the top plplot source directory as:
#
-# scripts/htdocs-gen_plot-examples.sh
+# WWW_USER=$USERNAME \
+# WWW_GROUP=$GROUPNAME \
+# WWW_HOST=$HOSTNAME \
+# WWW_DIR=$WEBSITE_PREFIX \
+# scripts/htdocs-gen_plot-examples.sh
#
-# The tarball will be copied to SourceForge and unpacked at the www area.
-# If your user name (as given by the environment variable USER) is different
-# as that at SF, then launch the script like this:
-#
-# WWW_USER=joeplplotter scripts/htdocs-gen_plot-examples.sh
-#
-# It is also possible to override the variables WWW_GROUP, WWW_HOST,
-# and WWW_DIR in the same way as with WWW_USER in the example above.
-#
+# where $USERNAME, $GROUPNAME, $HOSTNAME, and $WEBSITE_PREFIX are the
+# appropriate username, groupname, hostname, and website prefix directory
+# of the ssh-accessible site.
+
# To avoid rebuild launch it like this:
-# build=false scripts/htdocs-gen_plot-examples.sh
+# WWW_USER=$USERNAME \
+# WWW_GROUP=$GROUPNAME \
+# WWW_HOST=$HOSTNAME \
+# WWW_DIR=$WEBSITE_PREFIX \
+# build=false scripts/htdocs-gen_plot-examples.sh
+# Sanity checks.
+if test -z "$WWW_USER"; then
+ echo "must specify non-empty WWW_USER environment variable"
+ exit 1
+fi
+if test -z "$WWW_GROUP"; then
+ echo "must specify non-empty WWW_GROUP environment variable"
+ exit 1
+fi
+
+if test -z "$WWW_HOST"; then
+ echo "must specify non-empty WWW_HOST environment variable"
+ exit 1
+fi
+
+if test -z "$WWW_DIR"; then
+ echo "must specify non-empty WWW_DIR environment variable"
+ exit 1
+fi
+WWW_USER_AT_HOST=${WWW_USER}@$WWW_HOST
+
+# cp should preserve time stamps to make rsync more efficient for
+# website uploading to SourceForge.
+CP='cp -p'
+
# a fresh make, with minimum bindings
build=${build:-true}
if test "$build" = true; then
-# make clean
-# make configure
-#
-# ./configure --disable-static --enable-dyndrivers --prefix=/tmp/plplot \
-# --disable-cxx --disable-python --disable-java --disable-itcl \
-# --disable-octave --enable-f77 --enable-psttf --enable-psttfc
-#
rm -rf htdocsgen/build_dir htdocsgen/install
mkdir -p htdocsgen/build_dir htdocsgen/install
cd htdocsgen/build_dir
@@ -52,7 +79,7 @@
popd
# hack, x20c needs lena in the current directory
-cp examples/c/lena.pgm .
+$CP examples/c/lena.pgm .
for exe in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 21 22 \
23 24 25 26 27 28 29 30; do
@@ -103,7 +130,7 @@
examples/tcl/x${exe}.tcl \
; do
if test -f $f ; then
- cp $f $EXDIR/demo${exe}
+ $CP $f $EXDIR/demo${exe}
else
echo Example `basename $f` is not yet available \
> $EXDIR/demo${exe}/`basename $f`
@@ -141,14 +168,9 @@
tar cvzf $TARBALL htdocs
rm -rf htdocs
-# Transfer the tarball to Sourceforge and unpack it, such that the files will
+# Transfer the tarball to $WWW_HOST and unpack it, such that the files will
# appear in the PLplot web site
-WWW_GROUP=${WWW_GROUP:-plplot}
-WWW_HOST=${WWW_HOST:-shell.sf.net}
-WWW_USER_AT_HOST=${WWW_USER:+$WWW_USER@}$WWW_HOST
-WWW_DIR=${WWW_DIR:-/home/groups/p/pl/plplot}
-
echo "ssh $WWW_USER_AT_HOST mkdir -p $WWW_DIR"
ssh $WWW_USER_AT_HOST mkdir -p $WWW_DIR
echo "ssh $WWW_USER_AT_HOST rm -rf $WWW_DIR/$EXDIR"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|