From 1d35599bc3f92b6ca2176b90c8f70f632bd9966a Mon Sep 17 00:00:00 2001 From: Geert-Jan Giezeman Date: Mon, 6 Sep 1999 13:03:35 +0000 Subject: [PATCH] Adapted to new collect_cgal_testresults. The results_*.txt file now gets split in two (results_*.info added) --- .../test_handling/to_zipped_format | 69 ++++++++++++++++--- 1 file changed, 61 insertions(+), 8 deletions(-) diff --git a/Packages/Maintenance/test_handling/to_zipped_format b/Packages/Maintenance/test_handling/to_zipped_format index 6c2fd6f68d5..8cc1a529d92 100755 --- a/Packages/Maintenance/test_handling/to_zipped_format +++ b/Packages/Maintenance/test_handling/to_zipped_format @@ -2,6 +2,8 @@ use strict; +my $TMPDIR; + sub usage { print STDERR "$0: usage\n"; print STDERR "$0 result1.tar[.gz] ...\n"; @@ -10,18 +12,66 @@ sub usage { sub make_tempdir() { my $dirno = 1; - $::TMPDIR = "TMP$dirno"; - while ( -f $::TMPDIR or -d $::TMPDIR ) { + $TMPDIR = "TMP$dirno"; + while ( -f $TMPDIR or -d $TMPDIR ) { ++$dirno; - $::TMPDIR = "TMP$dirno"; + $TMPDIR = "TMP$dirno"; } - mkdir($::TMPDIR,0770) or die "Cannot create temporary directory $::TMPDIR\n"; + mkdir($TMPDIR,0770) or die "Cannot create temporary directory $TMPDIR\n"; +} + +sub reformat_results($) +{ + $_ = shift; + s/\.tar//; + my $platform = $_; + open (PLATFORM_RESULTS,"<${platform}.txt") or return; + while (/^\s*$/) { + $_= ; + } + open (PLATFORM_INFO,">$platform.info") or return; + open (PLATFORM_NEW_RESULTS,">${platform}.new_results") or return; + my ($CGAL_VERSION,$LEDA_VERSION,$TESTER,$GMP,$CLN) = ("-","-","-","-","-"); + while (! /^------/) { + if (/^CGAL_VERSION\s+(.+)$/) { + $CGAL_VERSION = $1; + } + if (/^LEDA\s+version\s+(.+)$/) { + $LEDA_VERSION = $1; + } + if (/^TESTER\s+(.+)$/) { + $TESTER = $1; + } + if (/GMP_SUPPORT\s*=\s*\'_GMP\'/) { + $GMP="+"; + } + if (/CLN_SUPPORT\s*=\s*\'_CLN\'/) { + $CLN="+"; + } + if (/LEDA_SUPPORT\s*=\s*\'_LEDA\'/ && $LEDA_VERSION eq "-") { + $LEDA_VERSION="+"; + } + $_= ; + } + while () { + print PLATFORM_NEW_RESULTS $_; + } + rename("${platform}.new_results","${platform}.txt"); + print PLATFORM_INFO <<"EOF"; +$TESTER +$CGAL_VERSION +$LEDA_VERSION +$GMP +$CLN +EOF + close(PLATFORM_INFO); + close(PLATFORM_RESULTS); + close(PLATFORM_NEW_RESULTS); } sub one_archive($) { my $archive = shift; - make_tempdir(); if (! -f $archive) { print STDERR "$archive is not a valid filename\n"; return 0; @@ -38,15 +88,18 @@ sub one_archive($) print STDERR "$0: $archive not a tar file\n"; return 0; } - rename("$archive","$::TMPDIR/$archive") or die; - chdir("$::TMPDIR") or die; + make_tempdir(); + rename("$archive","$TMPDIR/$archive") or die; + chdir("$TMPDIR") or die; system("tar", "xf", "$archive") == 0 or die; unlink($archive); + + reformat_results($archive); system('gzip',glob("*/*")); system('chmod','-R','a+r,og+w','.'); system('tar', 'cf', "../$archive", glob("*")) == 0 or die; chdir('..') or die; - system('rm', '-rf', "$::TMPDIR")== 0 or die; + system('rm', '-rf', "$TMPDIR")== 0 or die; return 1; }