Francois Gouget : winetest: Automatically create the directories needed by the cron job.
Alexandre Julliard
julliard at winehq.org
Mon Feb 13 15:17:09 CST 2017
Module: tools
Branch: master
Commit: 2f73328a396129146be84aef6dd28b524a5225d3
URL: http://source.winehq.org/git/tools.git/?a=commit;h=2f73328a396129146be84aef6dd28b524a5225d3
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Fri Feb 10 17:05:06 2017 +0100
winetest: Automatically create the directories needed by the cron job.
This simplifies the initial setup.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
winetest/winetest.cron | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/winetest/winetest.cron b/winetest/winetest.cron
index 2fb177c..4b60d10 100755
--- a/winetest/winetest.cron
+++ b/winetest/winetest.cron
@@ -27,17 +27,35 @@ expire=120
if [ ! -f $lock ]; then
touch $lock
cd $workdir
+
while $tools/dissect; [ $? -eq 0 -o $? -eq 1 ]; do true; done
updated=0
while $tools/gather; do updated=1; done
- [ $updated -eq 1 ] && $tools/build-index
+ if [ $updated -eq 1 -o ! -d data/tests -o ! -d old-data ]
+ then
+ mkdir -p data/tests old-data
+ $tools/build-index
+ fi
# archive old results
- (cd old-data && dir=`find . -maxdepth 1 -mtime +$expire -type d -print -quit` &&
- test -n "$dir" && tar cfj $dir.tar.bz2 $dir && touch -r $dir $dir.tar.bz2 && rm -rf $dir)
+ (
+ set -e
+ cd old-data
+ dir=`find . -maxdepth 1 -mtime +$expire -type d -print -quit`
+ test -n "$dir"
+ tar cfj $dir.tar.bz2 $dir
+ touch -r $dir $dir.tar.bz2
+ rm -rf $dir
+ )
# remove old test builds
- (cd builds && find . -mtime +$expire -name winetest\*.exe -print0 | xargs -0 rm -f)
+ (
+ set -e
+ mkdir -p builds
+ cd builds
+ find . -mtime +$expire -name winetest\*.exe -print0 | \
+ xargs -0 rm -f
+ )
# remove old queue files
find queue -maxdepth 1 -mtime +30 -name err\* -print0 | xargs -0 rm -rf
More information about the wine-cvs
mailing list