[Tools] winetest: Tweak winetest.cron so modifying it is not necessary.
Francois Gouget
fgouget at codeweavers.com
Thu Mar 23 21:31:07 CDT 2017
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
I think ultimately the same treatment should be applied to the dissect,
gather and build-index scripts so that modifying winetest.conf becomes
optional.
If applying this patch the corresponding crontab entry must be updated.
winetest/INSTALL.txt | 13 +++----------
winetest/winetest.cron | 17 ++++++++++++++---
2 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/winetest/INSTALL.txt b/winetest/INSTALL.txt
index a0bf6de..4d18490 100644
--- a/winetest/INSTALL.txt
+++ b/winetest/INSTALL.txt
@@ -86,17 +86,10 @@ FIXME The site script looks like it's meant to redirect from / to
The web site is essentially composed of static web pages that are
refreshed by perl scripts that are run at regular intervals.
-The script that orchestrates this is winetest.cron and it needs to be
-modified so it knows where the tools and workdir directories are
-located. Typically this would be:
+The script that orchestrates this is winetest.cron so set up a cron job
+in the winehq account to periodically update the pages:
- tools=/home/wine/tools/winetest
- workdir=/home/winehq/sites/winetest
-
-Then set up a cron job in the winehq account to periodically update
-the pages:
-
- */5 * * * * /home/wine/tools/winetest/winetest.cron
+ */5 * * * * /home/wine/tools/winetest/winetest.cron /home/winehq/sites/winetest
Still in the winehq account, you should run winetest.cron at least once
before accessing the web site so the initial set of web pages has been
diff --git a/winetest/winetest.cron b/winetest/winetest.cron
index 4b60d10..4fbd5a2 100755
--- a/winetest/winetest.cron
+++ b/winetest/winetest.cron
@@ -15,10 +15,21 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Cron job for generating winetest reports. Use it like
-# */5 * * * * apache winetest.cron
+# */5 * * * * winetest.cron WORKDIR
-tools=/home/winehq/opt/tools/winetest
-workdir=/home/winehq/opt/winetest
+name0=`basename "$0"`
+tools=`dirname "$0"`
+case "$tools" in
+ /*) ;; # Nothing to do
+ *) tools=`pwd`/"$tools" ;;
+esac
+
+workdir="$1"
+if [ -z "$workdir" ]
+then
+ echo "$name0:error: you must specify the work directory as the first parameter" >&2
+ exit 1
+fi
lock=/tmp/winetest.lock
# expiration age (in days) before results get archived
--
2.11.0
More information about the wine-patches
mailing list