prep for build machine downloads
diff --git a/downloadsites/webtools/artifacts/buildbranches.php b/downloadsites/webtools/artifacts/buildbranches.php
new file mode 100644
index 0000000..1043b92
--- /dev/null
+++ b/downloadsites/webtools/artifacts/buildbranches.php
@@ -0,0 +1,8 @@
+<?php
+$buildBranches = array();
+$buildBranches[0]="wtp-R3.0-I";
+$buildBranches[1]="wtp-R3.0-S";
+$buildBranches[2]="wtp-R3.0-R";
+$buildBranches[3]="wtp-R2.0-M";
+$buildBranches[4]="wtp-R2.0-R";
+?>
\ No newline at end of file
diff --git a/downloadsites/webtools/artifacts/computeMainData.php b/downloadsites/webtools/artifacts/computeMainData.php
new file mode 100755
index 0000000..9aa7383
--- /dev/null
+++ b/downloadsites/webtools/artifacts/computeMainData.php
@@ -0,0 +1,103 @@
+<?php
+
+function getSubDirectory($directoryName) {
+ if (file_exists($directoryName) && is_dir($directoryName)) {
+ //echo "Debug: anArtifactEntry (directory): " . $completeName . "<br />";
+ $aDirectory = dir($directoryName);
+ while (false !== ($anEntry = $aDirectory->read())) {
+ if ($anEntry != "." && $anEntry!="..") {
+ return $directoryName."/".$anEntry;
+ }
+ }
+ }
+}
+
+function computeMainData($buildBranches, $debugScript)
+
+{
+ global $buckets, $latestFile, $latestTimeStamp, $timeStamps;
+
+ foreach ($buildBranches as $buildBranch ) {
+
+ if (file_exists($buildBranch) && is_dir($buildBranch)) {
+ $aDirectory = dir($buildBranch);
+ $latestTimeStamp[$buildBranch] = array();
+ $latestFile[$buildBranch] = array();
+
+ while (false !== ($anArtifactEntry = $aDirectory->read())) {
+ //echo "anArtifactEntryDirectory: " . $anArtifactEntry . "<br />";
+
+ // Short cut because we know aDirectory only contains other directories.
+ if ($anArtifactEntry != "." && $anArtifactEntry!="..") {
+ $completeName = $buildBranch."/".$anArtifactEntry;
+ if (file_exists($completeName) && is_dir($completeName)) {
+ //echo "Debug: anArtifactEntry (directory): " . $completeName . "<br />";
+ $anArtifactEntryDirectory = dir($completeName);
+
+ while (false !== ($anEntry = $anArtifactEntryDirectory->read())) {
+
+ // Short cut because we know aDirectory only contains other directories.
+ if ($anEntry != "." && $anEntry!="..") {
+
+ //echo "Debug anEntry: $anEntry<br />" ;
+ $aDropDirectoryName = getSubDirectory($completeName);
+ //echo "Debug aDropDirectoryDirectoryName: $aDropDirectoryName <br />" ;
+
+
+ if (is_dir($aDropDirectoryName) && is_Readable($aDropDirectoryName)) {
+ $aDropDirectory = dir($aDropDirectoryName);
+ //echo "Debug aDropDirectory: $aDropDirectory->path <br />" ;
+
+ $fileCount = 0;
+ while ($aDropEntry = $aDropDirectory->read()) {
+ //echo "Debug aDropEntry: $aDropEntry<br />" ;
+ if ( (stristr($aDropEntry, ".tar.gz")) || (stristr($aDropEntry, ".zip")) ) {
+ // Count the dropfile entry in the directory (so we won't display links, if not all there
+ $fileCount = $fileCount + 1;
+ }
+ }
+
+ $aDropDirectory->close();
+
+ }
+ // Read the count file
+ $countFile = $aDropDirectoryName."/files.count";
+ $indexFile = $aDropDirectoryName."/index.html";
+
+
+ if (!file_exists($indexFile)) {
+ $indexFile = $aDropDirectoryName."/index.php";
+ }
+
+
+ if (file_exists($countFile) && file_exists($indexFile)) {
+ $anArray = file($countFile);
+ // echo "Debug: Number according to files.count: ", $anArray[0], "<br />";
+ // echo "Debug: actual counted files: ", $fileCount, "<br />";
+
+ // If a match - process the directoryVV -- we simply look that there's more
+ // zip's than we expect, since it frequently breaks where the count is slighly
+ // off, such as when we add, after the fact, an all-in-one zip.
+ if ($anArray[0] <= $fileCount) {
+ //echo "Debug: yes, counted equaled expected count<br />";
+ $anEntryLine = explode("/", $aDropDirectoryName);
+ $artifactTimeStamp = $anEntryLine[1]."/";
+ $entryParts = explode("-", $anEntryLine[2]);
+ if (count($entryParts) == 3) {
+ include '../processDropDirectory.php';
+ }
+ }
+ }
+
+ }
+ }
+ $anArtifactEntryDirectory->close();
+ }
+
+ }
+ }
+ $aDirectory->close();
+ }
+ }
+}
+?>
diff --git a/downloadsites/webtools/artifacts/index.php b/downloadsites/webtools/artifacts/index.php
index bd04bab..515e00c 100644
--- a/downloadsites/webtools/artifacts/index.php
+++ b/downloadsites/webtools/artifacts/index.php
@@ -59,6 +59,8 @@
<?php
+include 'buildbranches.php';
+include 'computeMainData.php';
include '../topAndInit.php';
include '../latestBuilds.php';
include '../recentHistory.php';
diff --git a/downloadsites/webtools/artifacts/report.php b/downloadsites/webtools/artifacts/report.php
deleted file mode 100644
index 8266879..0000000
--- a/downloadsites/webtools/artifacts/report.php
+++ /dev/null
@@ -1,147 +0,0 @@
-<?php
- function count_pattern($directory, $filenameFilter, $pattern)
- {
- $count = 0;
- $dir = dir($directory);
- while ($anEntry = $dir->read())
- {
- if ($anEntry != "." && $anEntry != "..")
- {
- $anEntry = $directory."/".$anEntry;
- if (is_dir($anEntry))
- {
- $count += count_pattern($anEntry, $filenameFilter, $pattern);
- }
- else
- {
- if (stristr($anEntry, $filenameFilter))
- {
- $handle = @fopen($anEntry, "r");
- if (FALSE !== $handle) {
- $size = filesize($anEntry);
- $content = fread($handle, $size);
- fclose($handle);
- $count += substr_count($content, $pattern);
- }
- }
- }
- }
- }
- return $count;
- }
-
- function parse_testResult($filename)
- {
- $junitFailures = 0;
- $compileErrors = 0;
- $compileWarnings = 0;
- if (is_file($filename)) {
- $handle = @fopen($filename, "r");
- if ($handle)
- {
- $size = filesize($filename);
- $content = fread($handle, $size);
- fclose($handle);
- $junitStart = strpos($content, "Errors & Failures");
- $junitEnd = strpos($content, "</table>", $junitStart);
- $junitInfo = substr($content, $junitStart, $junitEnd - $junitStart);
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">");
- while ($start !== false)
- {
- $start += 29;
- $stop = strpos($junitInfo, "</font></b></td>", $start);
- if ($stop !== false)
- {
- $result = substr($junitInfo, $start, $stop - $start);
- if (is_numeric($result))
- {
- $junitFailures += $result;
- }
- else if (strcmp($result, "DNF") == 0)
- {
- $junitFailures++;
- }
- }
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">", $stop);
- }
- $compileStart = strpos($content, "Compile Logs (Jar Files)");
- $compileEnd = strpos($content, "</table>", $compileStart);
- $compileInfo = substr($content, $compileStart, $compileEnd - $compileStart);
- $rowStart = strpos($compileInfo, "<tr>");
- while ($rowStart !== false)
- {
- $start += 4;
- $rowStop = strpos($compileInfo, "</tr>", $rowStart);
- if ($rowStop !== false)
- {
- $row = substr($compileInfo, $rowStart, $rowStop - $rowStart);
- $cellStart = strpos($row, "<td");
- $gotError = false;
- $gotWarning = false;
- while ($cellStart !== false && (!$gotError || !$gotWarning))
- {
- // this parsing logic got a bit more complicated in M2_33 basebuild, as the
- // tag <td align="center"> was used, instead of <td>
- // $cellStart += 4;
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "</td>", $cellStart);
- if ($cellStop !== false)
- {
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- if (!$gotError)
- {
- $compileErrors += $cell;
- $gotError = true;
- }
- else if (!$gotWarning)
- {
- $compileWarnings += $cell;
- $gotWarning = true;
- }
- }
- }
- // this parsing logic got a bit more complicated in M2_33 basebuild, as the
- // tag <td align="center"> was used, instead of <td>
- $cellStart = strpos($row, "<td", $cellStop);
- }
- }
- $rowStart = strpos($compileInfo, "<tr>", $rowStop);
- }
- }
- }
- $results = array($compileErrors, $compileWarnings, $junitFailures);
- return $results;
- }
-
- function parse($filename, $key)
- {
- if (!is_readable($filename))
- {
- return 0;
- }
- $value;
- $handle = @fopen($filename, "r");
- if (!$handle)
- {
- return 0;
- }
- $size = filesize($filename);
- $content = fread($handle, $size);
- fclose($handle);
- $start = strpos($content, $key);
- while ($start !== false)
- {
- $start += strlen($key);
- $stop = strpos($content, "\"", $start);
- if ($stop !== false)
- {
- $value += substr($content, $start, $stop - $start);
- }
- $start = strpos($content, $key, $stop);
- }
- return $value;
- }
-?>
diff --git a/downloadsites/webtools/artifacts/report2.php b/downloadsites/webtools/artifacts/report2.php
deleted file mode 100644
index 0859c0d..0000000
--- a/downloadsites/webtools/artifacts/report2.php
+++ /dev/null
@@ -1,127 +0,0 @@
-
- <?php
-
-function parse2_testResults($filename)
-{
- $junitFailures = -1;
- if (is_file($filename)) {
- $handle = @fopen($filename, "r");
- if ($handle)
- {
- $junitFailures = 0;
- $size = filesize($filename);
- $content = fread($handle, $size);
- fclose($handle);
- $junitStart = strpos($content, "Errors & Failures");
- $junitEnd = strpos($content, "</table>", $junitStart);
- $junitInfo = substr($content, $junitStart, $junitEnd - $junitStart);
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">");
- while ($start !== false)
- {
- $start += 29;
- $stop = strpos($junitInfo, "</font></b></td>", $start);
- if ($stop !== false)
- {
- $result = substr($junitInfo, $start, $stop - $start);
- if (is_numeric($result))
- {
- $junitFailures += $result;
- }
- else if (strcmp($result, "DNF") == 0)
- {
- $junitFailures++;
- }
- }
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">", $stop);
- }
- $results = array($junitFailures);
- return $results;
- }
- }
-}
-
-function parse2_compileResults($filename)
-{
- $compileErrors = 0;
- $compileAccessWarnings = 0;
- $compileOtherWarnings = 0;
- if (is_file($filename)) {
- //echo "$filename<br />";
- $handle = @fopen($filename, "r");
- if ($handle)
- {
- $size = filesize($filename);
- //echo "size: $size<br />";
- $content = fread($handle, $size);
- fclose($handle);
-
- //echo "$content";
- $compileStart = strpos($content, "<table id=tabledata");
- $compileEnd = strpos($content, "</table", $compileStart);
- $compileInfo = substr($content, $compileStart, $compileEnd - $compileStart);
- //echo "compileInfo: $compileInfo<br />";
- $rowStart = strpos($compileInfo, "<tr>");
- $rowStart = strpos($compileInfo, "<tr>");
- $start = $rowStart+4;
- while ($rowStart !== false)
- {
-
- $start += 4;
- $rowStop = strpos($compileInfo, "</tr>", $rowStart);
- //if ($rowStop !== false)
- //{
- $row = substr($compileInfo, $rowStart, $rowStop - $rowStart);
- //echo "$row";
- //while ($cellStart !== false)
- //{
- // this parsing logic got a bit more complicated in M5_33 basebuild, as the
- // a whole different structure was used.
- // we'll try to quick fix this, but need our own index task
- $cellStart = strpos($row, "#ERROR");
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "<", $cellStart);
- if ($cellStop !== false)
- {
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- $compileErrors += $cell;
- }
- $cellStart = strpos($row, "#ACCESSRULES_WARNINGS");
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "<", $cellStart);
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- $compileAccessWarnings += $cell;
- }
- $cellStart = strpos($row, "#OTHER_WARNINGS");
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "<", $cellStart);
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- $compileOtherWarnings += $cell;
- }
- }
- // look for next row.
- //$cellStart = strpos($row, "<tr", $cellStop);
- //}
- //}
- $rowStart = strpos($compileInfo, "<tr>", $rowStop);
- }
- }
- }
-
- $results = array($compileErrors, $compileAccessWarnings, $compileOtherWarnings);
- return $results;
-}
-
-
-
-?>
-
-
diff --git a/downloadsites/webtools/buildMachine/cleanup.sh b/downloadsites/webtools/buildMachine/cleanup.sh
deleted file mode 100644
index 54cf1b8..0000000
--- a/downloadsites/webtools/buildMachine/cleanup.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-# script to delete warm-up builds, except the one promoted
-# the promoted on is left just for safety
-
-
-declaredStream=$1
-declaredDir=$2
-# make sure directories to delete start with same 3 chars as target
-pattern=${declaredDir:0:5}
-
-
-echo restrict to directory names that match $pattern
-echo act on directories older than $declaredDir
-
-
-# example of full form from command line
-# find ./drops -maxdepth 1 -type d -name I-I* -not -cnewer drops/I-I200603180020-200603180020 -exec rm -fr {} \;
-
-
-if [ "$3" != "-doit" ] ; then
- echo " This is a dry run. Add -doit to actually remove"
- thisCommand=" echo "
-else
- thisCommand=" rm -fr "
-fi
-
-
-
-find ./drops -maxdepth 2 -type d -name "$pattern*" -not -newer "./drops/$declaredStream/$declaredDir" -exec $thisCommand {} \;
-
-
-
-
diff --git a/downloadsites/webtools/buildMachine/declare.sh b/downloadsites/webtools/buildMachine/declare.sh
deleted file mode 100644
index 4700d7f..0000000
--- a/downloadsites/webtools/buildMachine/declare.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-echo $1 $2
-
-declaredStream=$1
-declaredDir=$2
-
-FROMDIR=../committers/drops
-TODIR=../downloads/drops/${declaredStream}
-FROMDIR=$FROMDIR/${declaredStream}/${declaredDir}
-echo "declaring build ${declaredDir} on buildstream ${declaredStream}"
-echo " into ${TODIR}"
-echo " using the build from ${FROMDIR}"
-
-
-cp -R ${FROMDIR} ${TODIR}
-
-fromString="webtools/committers"
-toString="webtools/downloads"
-replaceCommand="s!${fromString}!${toString}!g"
-
-perl -w -pi -e ${replaceCommand} ${TODIR}/${declaredDir}/*.php
-
-# update the update site
-#cp -ruv $HOME/downloads/webtools/committers/drops/$1/updateSite/features/ $HOME/downloads/webtools/milestones/
-#cp -ruv $HOME/downloads/webtools/committers/drops/$1/updateSite/plugins/ $HOME/downloads/webtools/milestones/
diff --git a/downloadsites/webtools/buildMachine/declareUpdates.sh b/downloadsites/webtools/buildMachine/declareUpdates.sh
deleted file mode 100644
index 0095491..0000000
--- a/downloadsites/webtools/buildMachine/declareUpdates.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-
-declaredStream=$1
-declaredDir=$2
-
-FROMDIR=$HOME/downloads/webtools/committers/drops
-FROMDIR=$FROMDIR/${declaredStream}/${declaredDir}/updateSite
-
-TODIR=$HOME/downloads/webtools/declaredUpdates
-
-echo "declaring update ${declaredDir} on buildstream ${declaredStream}"
-echo " into ${TODIR}"
-echo " using the build from ${FROMDIR}"
-
-
-# update the update site with changes only
-rsync --ignore-existing -rv $FROMDIR/features $TODIR
-rsync --ignore-existing -rv $FROMDIR/plugins $TODIR
diff --git a/downloadsites/webtools/buildMachine/dlconfig.txt b/downloadsites/webtools/buildMachine/dlconfig.txt
deleted file mode 100644
index 8cf2851..0000000
--- a/downloadsites/webtools/buildMachine/dlconfig.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-dropPrefix[]=R&
-dropPrefix[]=M&
-dropPrefix[]=S&
-dropPrefix[]=I&
-dropPrefix[]=N&
-
-dropType[]=<b>R</b>eleased (In progress)&
-dropType[]=<b>M</b>aintenance (In progress)&
-dropType[]=<b>S</b>table (Milestone) (In progress)&
-dropType[]=<b>I</b>ntegration (In progress)&
-dropType[]=<b>N</b>ightly (Head) Build&
diff --git a/downloadsites/webtools/buildMachine/index.php b/downloadsites/webtools/buildMachine/index.php
deleted file mode 100644
index bd04bab..0000000
--- a/downloadsites/webtools/buildMachine/index.php
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?> \n" ;
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
-<?php
-include 'pagePropertyVariables.php';
-?>
-
-<link rel="stylesheet" href="http://dev.eclipse.org/default_style.css" />
-<link rel="stylesheet" href="../wtpDropStyle.css" />
-<title><?php echo $pageTitle; ?></title>
-</head>
-<body>
-
-
-<?php
-
-// tiny banner to remind when looking at "local" machine results
-$serverName = $_SERVER["SERVER_NAME"];
-
-if (!stristr($serverName, "eclipse.org") && !stristr($serverName,"you.are.at.eclipsecon.org")) {
- echo '<center>
- <p>
- Reminder: this is <font color="#FF0000">' .
- $serverName .
- '</font>
- See also
- <a href="http://download.eclipse.org/webtools/downloads" target="_top">
- the live public Eclipse site
- </a>.
- </p>
- <hr />
- </center>';
-
-}
-
-if (function_exists("date_default_timezone_set")) {
- date_default_timezone_set("UTC");
- //echo "<p>default timezone: ";
- //echo date_default_timezone_get();
- //echo "</p>";
-}
-
-?>
-
-
-<?php
-ini_set("display_errors", "true");
-error_reporting (E_ALL);
-?>
-
-<?php
-$QString = $_SERVER['QUERY_STRING'];
-$C = strcmp($QString, "test");
-?>
-
-
-<?php
-include '../topAndInit.php';
-include '../latestBuilds.php';
-include '../recentHistory.php';
-include '../bottomAndFooter.php';
-?>
-
-
-</body>
-</html>
-
diff --git a/downloadsites/webtools/buildMachine/pagePropertyVariables.php b/downloadsites/webtools/buildMachine/pagePropertyVariables.php
deleted file mode 100644
index 967b78e..0000000
--- a/downloadsites/webtools/buildMachine/pagePropertyVariables.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-$pageTitle="Eclipse Web Tools Platform (WTP) Downloads - for Committers and
-Early Testers";
-$indexTop="<font class=indextop>
-Web Tools Platform<br />
-committer downloads</font><br />
-<font class=indexsub>Latest early trial downloads from the Web Tools Platform project</font>";
-
-$pageExplanation="
- <p>This is the starting page for where you can find the latest <a
- href=\"http://wiki.eclipse.org/index.php/WTP_Build_Types\">continuous build</a> produced by the <a
- href=\"http://www.eclipse.org/webtools/main.php\">Eclipse Web Tools
- Platform (WTP) Project</a>. Please note that each build page details
- the pre-reqs for that particular build.</p>
-
- <p>If you got here to this continuous-build site by accident or casual
- browsing, please be aware that <a
- href=\"http://download.eclipse.org/webtools/downloads/\" target=\"_top\">
- declared builds</a> are available!</p>
-
-";
-
-$mainTableHeader="Latest Downloads (In progress, towards a declared build)";
-
-$pageFooterEnd="<p><a href=\"http://download.eclipse.org/webtools/downloads/\"
- target=\"_top\">Declared builds</a> are available which are for
- end-users and adopters.</p>";
-
-$subsectionHeading="Recent History";
-
-?>
\ No newline at end of file
diff --git a/downloadsites/webtools/buildMachine/rename.sh b/downloadsites/webtools/buildMachine/rename.sh
deleted file mode 100644
index 8d8b1f8..0000000
--- a/downloadsites/webtools/buildMachine/rename.sh
+++ /dev/null
@@ -1,312 +0,0 @@
-#!/bin/bash
-
-# build renamer script - fix/rename all of a given I/M/S build's artefacts instead of regen'ing them
-# copy existing build folder; rename zips, md5s; sed text files
-
-# default path to builds
-buildDropsDir=$PWD;
-
-tmpdir=/home/data/users/jlanuti/downloads/webtools/committers/drops/tmp-renameBuild.sh-$USER;
-mkdir -p $tmpdir;
-
-verbose="";
-pairs="";
-
-# to use these colour escapes, must do `echo -e -e`
-red="\033[1;31m"; green="\033[1;32m";
-yellow="\033[1;33m"; blue="\033[1;34m"
-norm="\033[0;39m";
-
-# default to default properties file
-defaultPropertiesFile=./promoteToEclipse.properties
-propertiesFiles="";
-
-if [ $# -lt 1 ]; then
- echo "";
- echo "[ren] This script is used to copy, then rename an existing local build so that it can be promoted";
- echo " again under a new name. By renaming instead of rebuilding, binary compatibility is possible";
- echo " w/o having to retest. If -sub is not specified, script will look for the folder to rename ";
- echo -e " in the current folder ("$yellow""$PWD""$norm").";
- echo "";
- echo "[ren] Usage (<> = required, [] = optional, string replacements must be listed LAST, and will be";
- echo " processed IN ORDER listed.):";
- echo "";
- echo -e " "$green"sudo -u www-data $PWD/renameBuild.sh"$norm" [-sub <subprojectName>] \\"
- echo -e " -branch [sourceBranch"$blue"="$norm"]<targetBranch> -buildID <sourceBuildID"$blue"="$norm"targetBuildID> \\"
- echo -e " -buildAlias [sourceAlias"$blue"="$norm"]<targetAlias> \\";
- echo -e " [-verbose] [-buildDropsDir /path/to/some/folder] \\";
- echo -e " [beforestring"$blue"="$norm"afterstring] [beforestring2"$blue"="$norm"afterstring2] ... \\";
- echo -e " "$yellow"2>&1 | tee ~/renameBuild_\`date +%Y%m%d_%H%M%S\`.txt"$norm"";
- echo "";
- echo "[ren] To rename with string replacements [Eclipse driver folder & file]: ";
- echo "";
- echo -e " "$green"sudo -u www-data $PWD/renameBuild.sh"$norm" -sub "$red"emf"$norm" -verbose \\";
- echo -e " -branch 2.2.0 -buildID S200606271057"$blue"="$norm"R200606271057 -buildAlias 2.2.0RC9a"$blue"="$norm"2.2.0 \\";
- echo -e " eclipse-SDK-M20060609-1217-linux-gtk.tar.gz"$blue"="$norm"eclipse-SDK-3.2-linux-gtk.tar.gz \\";
- echo -e " M20060609-1217"$blue"="$norm"R-3.2-200606281325 \\";
- echo -e " /eclipse/downloads/drops/"$blue"="$norm"http://download.eclipse.org/downloads/drops/ \\"; # TODO: remove this hack once index.html pages are fixed after 2.2.0
- echo -e " fullmoon.torolab.ibm.com"$blue"="$norm"download.eclipse.org";
- echo "";
- echo "[ren] To rename with string replacements [Eclipse + EMF driver folders & files]: ";
- echo "";
- echo -e " "$green"sudo -u www-data $PWD/renameBuild.sh"$norm" -sub "$red"uml2"$norm" -verbose \\";
- echo -e " -branch 2.0.0 -buildID S200606221411"$blue"="$norm"R200606221411 -buildAlias 2.0RC9a"$blue"="$norm"2.0.0 \\";
- echo -e " eclipse-SDK-M20060609-1217-linux-gtk.tar.gz"$blue"="$norm"eclipse-SDK-3.2-linux-gtk.tar.gz \\";
- echo -e " M20060609-1217"$blue"="$norm"R-3.2-200606281325 \\";
- echo -e " /eclipse/downloads/drops/"$blue"="$norm"http://download.eclipse.org/downloads/drops/ \\"; # TODO: remove this hack once index.html pages are fixed after 2.0.0
- echo -e " emf-sdo-xsd-SDK-2.2.0RC9.zip"$blue"="$norm"emf-sdo-xsd-SDK-2.2.0.zip \\";
- echo -e " S200606221156"$blue"="$norm"R200606271057 \\";
- #echo -e " /tools/emf/downloads/drops/"$blue"="$norm"../../../../../../tools/emf/downloads/drops/ \\"; # TODO: remove this hack once index.html pages are fixed after 2.0.0
- echo -e " fullmoon.torolab.ibm.com"$blue"="$norm"download.eclipse.org";
- echo -e " emf.torolab.ibm.com"$blue"="$norm"download.eclipse.org";
- echo "";
- echo -e " "$green"sudo -u www-data $PWD/renameBuild.sh"$norm" -sub "$red"ocl"$norm" -verbose \\";
- echo -e " -branch 1.0.0 -buildID S200606261119"$blue"="$norm"R200606261119 -buildAlias 1.0.0RC6"$blue"="$norm"1.0.0 \\";
- echo -e " eclipse-SDK-M20060609-1217-linux-gtk.tar.gz"$blue"="$norm"eclipse-SDK-3.2-linux-gtk.tar.gz \\";
- echo -e " M20060609-1217"$blue"="$norm"R-3.2-200606281325 \\";
- echo -e " emf-sdo-xsd-SDK-2.2.0RC9.zip"$blue"="$norm"emf-sdo-xsd-SDK-2.2.0.zip \\";
- echo -e " S200606221156"$blue"="$norm"R200606271057 \\";
- echo -e " fullmoon.torolab.ibm.com"$blue"="$norm"download.eclipse.org";
- echo -e " emf.torolab.ibm.com"$blue"="$norm"download.eclipse.org";
- echo "";
- exit;
-fi
-
-echo "";
-echo -e "[ren] Started `date +%Y%m%d\ %H\:%M\:%S`.";
-
-# collect cmdline options
-while [ $# -gt 0 ]; do
- case $1 in
- '-branch')
- # check if param 2 contains a "="
- t=$2;t=${t##*=*}; # get a nullstring if there was a "=" in the string
- if [ "x$t" = "x" ]; then # $
- sourceBranch=$2; sourceBranch=${sourceBranch%%=*}; # trim from = to end
- targetBranch=$2; targetBranch=${targetBranch##*=}; # trim up to the =
- else
- sourceBranch=$2;
- targetBranch=$2;
- fi
- shift 1;
- ;;
- '-buildID')
- sourceBuildID=$2; sourceBuildID=${sourceBuildID%%=*}; # trim from = to end
- targetBuildID=$2; targetBuildID=${targetBuildID##*=}; # trim up to the =
- shift 1;
- ;;
- '-buildAlias')
- # check if param 2 contains a "="
- t=$2;t=${t##*=*}; # get a nullstring if there was a "=" in the string
- if [ "x$t" = "x" ]; then # $
- sourceAlias=$2; sourceAlias=${sourceAlias%%=*}; # trim from = to end
- targetAlias=$2; targetAlias=${targetAlias##*=}; # trim up to the =
- else
- sourceAlias=$sourceBuildID;
- targetAlias=$2;
- fi
- shift 1;
- ;;
- '-sub')
- subprojectName=$2;
- #echo " $1 $2";
- # chain them together in order of priority: override (if applic), subproj specific one, default
- propertiesFiles=$propertiesFiles" ./promoteToEclipse."$subprojectName".properties "$defaultPropertiesFile;
- loaded=0;
- for propertiesFile in $propertiesFiles; do
- if [ "$loaded" -eq 0 ] && [ -r $propertiesFile ]; then
- echo -n " [loading $propertiesFile ... "; . $propertiesFile; echo "done]"; loaded=1;
- fi
- done
- if [ "$loaded" -eq 0 ]; then
- echo " [Can't load any of: $propertiesFiles. Exiting!]";
- exit 99;
- fi
- shift 1
- ;;
-
- '-buildDropsDir')
- buildDropsDir=$2;
- shift 1;
- ;;
- '-verbose')
- verbose="true";
- shift 0;
- ;;
- *)
- pairs=$pairs" "$1;
- shift 0;
- ;;
- esac
- shift 1
-done
-
-if [ "$subprojectName" = "" ]; then # no value set!
- echo "[promote] No subproject name set in properties file or by -sub flag. Script cannot continue. Exiting...";
- exit 99;
-fi
-
-getBuildType ()
-{
- tmpType=$1; tmpType=${tmpType:0:1}; # one of N, M, I, S, R
- #echo -e "tmpType=$tmpType";
- case $tmpType in
- 'N')
- tmpType='Nightly';
- ;;
- 'M')
- tmpType='Maintenance';
- ;;
- 'I')
- tmpType='Integration';
- ;;
- 'S')
- tmpType='Stable';
- ;;
- 'R')
- tmpType='Release';
- ;;
- esac
-}
-
-getBuildType $sourceBuildID; sourceType=$tmpType;
-getBuildType $targetBuildID; targetType=$tmpType;
-
-echo "";
-echo -e "[ren] Source: branch=$red$sourceBranch$norm; build=$red$sourceBuildID$norm; type=$red$sourceType$norm; alias=$red$sourceAlias$norm";
-echo -e "[ren] Target: branch=$green$targetBranch$norm; build=$green$targetBuildID$norm; type=$green$targetType$norm; alias=$green$targetAlias$norm";
-if [ "x$verbose" != "x" ] && [ "x$pairs" != "x" ]; then
- echo -e "[ren] Substitution pairs:";
- for pair in $pairs; do
- before=$pair; before=${before%%=*}; # trim from the = to the end
- after=$pair; after=${after##*=}; # trim up to the =
- if [ "$before" != "$after" ]; then
- echo -e " $red$before$norm -> $green$after$norm";
- fi
- done
-fi
-
-# define source/target folders
-sourceFolder="$buildDropsDir/$sourceBranch/$sourceBuildID";
-targetFolder="$buildDropsDir/$targetBranch/$targetBuildID";
-
-echo "";
-echo -e "[ren] Step 1: copy $sourceFolder";
-echo -e " to $targetFolder";
-mkdir -p $targetFolder; cp -r $sourceFolder/* $targetFolder/;
-
-echo ""; echo -e "[ren] Step 2: rename any zip/md5 files in target folder matching "$sourceBuildID;
-cd $targetFolder;
-
-list=`find $targetFolder -name "*$sourceBuildID\.zip*" -o -name "*$sourceAlias\.zip*"`
-num=0;
-for file in $list; do
- (( num++ ));
-done
-
-cnt=0;
-for file in $list; do
- (( cnt++ ));
- targ="$file";
- targ="${targ//$sourceAlias/$targetAlias}";
- targ="${targ//$sourceBuildID/$targetAlias}";
- targ="${targ//$sourceBranch/$targetBranch}";
- if [ "x$verbose" != "x" ]; then
- echo -e "[ren] [$blue$cnt$norm/$blue$num$norm] "${file##*\/}" -> "${targ##*\/};
- fi
- mv -f "$file" "$targ";
-done
-
-if [ "x$verbose" = "x" ]; then
- echo -e "[ren] $green$num$norm files renamed.";
-fi
-
-echo "";
-echo -e "[ren] Step 3: fix text files (xml, md5, html, txt) with $red$sourceAlias$norm, $red$sourceBuildID$norm, $red$sourceBranch$norm or $red$sourceType$norm";
-
-# pass in a /fully/qualifed/path/to/a/file and a group owner (eg., www-data); fsize will contain the filesize in bytes
-getFileSize()
-{
- f=$1; # file name
- g=$2; # group name
- fsize=`alias ls='ls' && ls -ls "$f"`; fsize=${fsize%%"$f"*}; fsize=${fsize##*$g};
- fsize=`echo -e $fsize | sed -e 's/[a-zA-Z\-]//g' -e 's/.* //g' -e 's/[0-9]\+\ \+[0-9]\+\:[0-9]\+//g' -e 's/[\/\ \.]\+//g'`
-}
-
-totalnum=0;
-for ext in "xml" "md5" "html" "txt" "cfg" "php"; do
- list=`find $targetFolder -name "*\.$ext"`;
- num=0;
- for file in $list; do
- (( totalnum++ ));
- (( num++ ));
- done
-
- cnt=0;
- for file in $list; do
- (( cnt++ ));
- if [ `cat $file | grep -c "$sourceBuildID\|$sourceBranch"` > 0 ]; then # file contains the string, must sed it
- filename="${file##*\/}";
- tmpfile="$tmpdir/$filename";
- tmpfile2="$tmpdir/$filename"2;
- if [ "x$verbose" != "x" ]; then
- echo -e -n "[ren] [$blue$cnt$norm/$blue$num$norm] Replacing $yellow$filename$norm: ";
- fi
-
- # get old filesize
- getFileSize "$file" "www-data"; res1=$fsize;
-
- # make changes:
- # replace "N2004...".zip with "2.0.2".zip
- # replace "Nightly Build: N2004..." with "Release Build: 2.0.2"
- # replace "Nightly" with "Release"
- # replace "N2004..." with "R2004..."
- # replace "2.0.3.1" with "2.0.4"
-
- # to escape "." as "\." use ${foo//./\\.} instead of $foo
- cat "$file" | sed \
- -e 's/'${sourceAlias//./\\.}'/'${targetAlias//./\\.}'/g' \
- -e 's/'${sourceBuildID//./\\.}\.zip'/'${targetAlias//./\\.}\.zip'/g' \
- -e 's/'$sourceType' Build\: '${sourceBuildID//./\\.}'/'$targetType' Build\: '${targetAlias//./\\.}'/g' \
- -e 's/'$sourceType'/'$targetType'/g' \
- -e 's/'${sourceBuildID//./\\.}'/'${targetBuildID//./\\.}'/g' \
- -e 's/'${sourceBranch//./\\.}'/'${targetBranch//./\\.}'/g' \
- > "$tmpfile";
-
- # replace <beforestring> with <afterstring>, eg., eclipse-SDK-I20050201-0800-linux-gtk.zip with eclipse-SDK-3.1M5-linux-gtk.tar.gz
- if [ "x$pairs" != "x" ]; then
- for pair in $pairs; do
- before=$pair; before=${before%%=*}; # trim from the = to the end
- after=$pair; after=${after##*=}; # trim up to the =
- before=${before//\//\\\/}; before=${before//./\\.}; # escape "." and "/"
- after=${after//\//\\\/}; after=${after//./\\.}; # escape "." and "/"
- if [ "$before" != "$after" ]; then
- cat "$tmpfile" | sed -e 's/'"$before"'/'"$after"'/g' > "$tmpfile2";
- mv -f "$tmpfile2" "$tmpfile";
- fi
- done
- fi
-
- # get new filesize
- getFileSize "$tmpfile" "www-data"; res2=$fsize;
-
- # replace file
- if [ "x$verbose" != "x" ]; then
- echo -e "size: $res1 -> $res2";
- fi
- mv -f "$tmpfile" "$file";
- fi
- done
- if [ "x$verbose" != "x" ]; then
- echo "";
- fi
-done
-
-if [ "x$verbose" = "x" ]; then
- echo -e "[ren] $green$totalnum$norm files changed.";
- echo "";
-fi
-
-rm -fr $tmpdir;
-echo "[ren] Finished `date +%Y%m%d\ %H\:%M\:%S`. Please verify that your build's index.html contains no invalid links.";
-echo "";
diff --git a/downloadsites/webtools/buildMachine/report.php b/downloadsites/webtools/buildMachine/report.php
deleted file mode 100644
index 8266879..0000000
--- a/downloadsites/webtools/buildMachine/report.php
+++ /dev/null
@@ -1,147 +0,0 @@
-<?php
- function count_pattern($directory, $filenameFilter, $pattern)
- {
- $count = 0;
- $dir = dir($directory);
- while ($anEntry = $dir->read())
- {
- if ($anEntry != "." && $anEntry != "..")
- {
- $anEntry = $directory."/".$anEntry;
- if (is_dir($anEntry))
- {
- $count += count_pattern($anEntry, $filenameFilter, $pattern);
- }
- else
- {
- if (stristr($anEntry, $filenameFilter))
- {
- $handle = @fopen($anEntry, "r");
- if (FALSE !== $handle) {
- $size = filesize($anEntry);
- $content = fread($handle, $size);
- fclose($handle);
- $count += substr_count($content, $pattern);
- }
- }
- }
- }
- }
- return $count;
- }
-
- function parse_testResult($filename)
- {
- $junitFailures = 0;
- $compileErrors = 0;
- $compileWarnings = 0;
- if (is_file($filename)) {
- $handle = @fopen($filename, "r");
- if ($handle)
- {
- $size = filesize($filename);
- $content = fread($handle, $size);
- fclose($handle);
- $junitStart = strpos($content, "Errors & Failures");
- $junitEnd = strpos($content, "</table>", $junitStart);
- $junitInfo = substr($content, $junitStart, $junitEnd - $junitStart);
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">");
- while ($start !== false)
- {
- $start += 29;
- $stop = strpos($junitInfo, "</font></b></td>", $start);
- if ($stop !== false)
- {
- $result = substr($junitInfo, $start, $stop - $start);
- if (is_numeric($result))
- {
- $junitFailures += $result;
- }
- else if (strcmp($result, "DNF") == 0)
- {
- $junitFailures++;
- }
- }
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">", $stop);
- }
- $compileStart = strpos($content, "Compile Logs (Jar Files)");
- $compileEnd = strpos($content, "</table>", $compileStart);
- $compileInfo = substr($content, $compileStart, $compileEnd - $compileStart);
- $rowStart = strpos($compileInfo, "<tr>");
- while ($rowStart !== false)
- {
- $start += 4;
- $rowStop = strpos($compileInfo, "</tr>", $rowStart);
- if ($rowStop !== false)
- {
- $row = substr($compileInfo, $rowStart, $rowStop - $rowStart);
- $cellStart = strpos($row, "<td");
- $gotError = false;
- $gotWarning = false;
- while ($cellStart !== false && (!$gotError || !$gotWarning))
- {
- // this parsing logic got a bit more complicated in M2_33 basebuild, as the
- // tag <td align="center"> was used, instead of <td>
- // $cellStart += 4;
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "</td>", $cellStart);
- if ($cellStop !== false)
- {
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- if (!$gotError)
- {
- $compileErrors += $cell;
- $gotError = true;
- }
- else if (!$gotWarning)
- {
- $compileWarnings += $cell;
- $gotWarning = true;
- }
- }
- }
- // this parsing logic got a bit more complicated in M2_33 basebuild, as the
- // tag <td align="center"> was used, instead of <td>
- $cellStart = strpos($row, "<td", $cellStop);
- }
- }
- $rowStart = strpos($compileInfo, "<tr>", $rowStop);
- }
- }
- }
- $results = array($compileErrors, $compileWarnings, $junitFailures);
- return $results;
- }
-
- function parse($filename, $key)
- {
- if (!is_readable($filename))
- {
- return 0;
- }
- $value;
- $handle = @fopen($filename, "r");
- if (!$handle)
- {
- return 0;
- }
- $size = filesize($filename);
- $content = fread($handle, $size);
- fclose($handle);
- $start = strpos($content, $key);
- while ($start !== false)
- {
- $start += strlen($key);
- $stop = strpos($content, "\"", $start);
- if ($stop !== false)
- {
- $value += substr($content, $start, $stop - $start);
- }
- $start = strpos($content, $key, $stop);
- }
- return $value;
- }
-?>
diff --git a/downloadsites/webtools/buildMachine/report2.php b/downloadsites/webtools/buildMachine/report2.php
deleted file mode 100644
index 0859c0d..0000000
--- a/downloadsites/webtools/buildMachine/report2.php
+++ /dev/null
@@ -1,127 +0,0 @@
-
- <?php
-
-function parse2_testResults($filename)
-{
- $junitFailures = -1;
- if (is_file($filename)) {
- $handle = @fopen($filename, "r");
- if ($handle)
- {
- $junitFailures = 0;
- $size = filesize($filename);
- $content = fread($handle, $size);
- fclose($handle);
- $junitStart = strpos($content, "Errors & Failures");
- $junitEnd = strpos($content, "</table>", $junitStart);
- $junitInfo = substr($content, $junitStart, $junitEnd - $junitStart);
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">");
- while ($start !== false)
- {
- $start += 29;
- $stop = strpos($junitInfo, "</font></b></td>", $start);
- if ($stop !== false)
- {
- $result = substr($junitInfo, $start, $stop - $start);
- if (is_numeric($result))
- {
- $junitFailures += $result;
- }
- else if (strcmp($result, "DNF") == 0)
- {
- $junitFailures++;
- }
- }
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">", $stop);
- }
- $results = array($junitFailures);
- return $results;
- }
- }
-}
-
-function parse2_compileResults($filename)
-{
- $compileErrors = 0;
- $compileAccessWarnings = 0;
- $compileOtherWarnings = 0;
- if (is_file($filename)) {
- //echo "$filename<br />";
- $handle = @fopen($filename, "r");
- if ($handle)
- {
- $size = filesize($filename);
- //echo "size: $size<br />";
- $content = fread($handle, $size);
- fclose($handle);
-
- //echo "$content";
- $compileStart = strpos($content, "<table id=tabledata");
- $compileEnd = strpos($content, "</table", $compileStart);
- $compileInfo = substr($content, $compileStart, $compileEnd - $compileStart);
- //echo "compileInfo: $compileInfo<br />";
- $rowStart = strpos($compileInfo, "<tr>");
- $rowStart = strpos($compileInfo, "<tr>");
- $start = $rowStart+4;
- while ($rowStart !== false)
- {
-
- $start += 4;
- $rowStop = strpos($compileInfo, "</tr>", $rowStart);
- //if ($rowStop !== false)
- //{
- $row = substr($compileInfo, $rowStart, $rowStop - $rowStart);
- //echo "$row";
- //while ($cellStart !== false)
- //{
- // this parsing logic got a bit more complicated in M5_33 basebuild, as the
- // a whole different structure was used.
- // we'll try to quick fix this, but need our own index task
- $cellStart = strpos($row, "#ERROR");
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "<", $cellStart);
- if ($cellStop !== false)
- {
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- $compileErrors += $cell;
- }
- $cellStart = strpos($row, "#ACCESSRULES_WARNINGS");
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "<", $cellStart);
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- $compileAccessWarnings += $cell;
- }
- $cellStart = strpos($row, "#OTHER_WARNINGS");
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "<", $cellStart);
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- $compileOtherWarnings += $cell;
- }
- }
- // look for next row.
- //$cellStart = strpos($row, "<tr", $cellStop);
- //}
- //}
- $rowStart = strpos($compileInfo, "<tr>", $rowStop);
- }
- }
- }
-
- $results = array($compileErrors, $compileAccessWarnings, $compileOtherWarnings);
- return $results;
-}
-
-
-
-?>
-
-
diff --git a/downloadsites/webtools/committers/buildbranches.php b/downloadsites/webtools/committers/buildbranches.php
new file mode 100644
index 0000000..60d0dfe
--- /dev/null
+++ b/downloadsites/webtools/committers/buildbranches.php
@@ -0,0 +1,8 @@
+<?php
+$buildBranches = array();
+$buildBranches[0]="drops/R3.0";
+$buildBranches[1]="drops/R2.0";
+$buildBranches[2]="drops/R1.5";
+$buildBranches[3]="drops/R1.0";
+$buildBranches[4]="drops/R0.7";
+?>
\ No newline at end of file
diff --git a/downloadsites/webtools/committers/index.php b/downloadsites/webtools/committers/index.php
index bd04bab..0096cda 100644
--- a/downloadsites/webtools/committers/index.php
+++ b/downloadsites/webtools/committers/index.php
@@ -59,6 +59,7 @@
<?php
+include 'buildbranches.php';
include '../topAndInit.php';
include '../latestBuilds.php';
include '../recentHistory.php';
diff --git a/downloadsites/webtools/committers/report.php b/downloadsites/webtools/committers/report.php
deleted file mode 100644
index 8266879..0000000
--- a/downloadsites/webtools/committers/report.php
+++ /dev/null
@@ -1,147 +0,0 @@
-<?php
- function count_pattern($directory, $filenameFilter, $pattern)
- {
- $count = 0;
- $dir = dir($directory);
- while ($anEntry = $dir->read())
- {
- if ($anEntry != "." && $anEntry != "..")
- {
- $anEntry = $directory."/".$anEntry;
- if (is_dir($anEntry))
- {
- $count += count_pattern($anEntry, $filenameFilter, $pattern);
- }
- else
- {
- if (stristr($anEntry, $filenameFilter))
- {
- $handle = @fopen($anEntry, "r");
- if (FALSE !== $handle) {
- $size = filesize($anEntry);
- $content = fread($handle, $size);
- fclose($handle);
- $count += substr_count($content, $pattern);
- }
- }
- }
- }
- }
- return $count;
- }
-
- function parse_testResult($filename)
- {
- $junitFailures = 0;
- $compileErrors = 0;
- $compileWarnings = 0;
- if (is_file($filename)) {
- $handle = @fopen($filename, "r");
- if ($handle)
- {
- $size = filesize($filename);
- $content = fread($handle, $size);
- fclose($handle);
- $junitStart = strpos($content, "Errors & Failures");
- $junitEnd = strpos($content, "</table>", $junitStart);
- $junitInfo = substr($content, $junitStart, $junitEnd - $junitStart);
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">");
- while ($start !== false)
- {
- $start += 29;
- $stop = strpos($junitInfo, "</font></b></td>", $start);
- if ($stop !== false)
- {
- $result = substr($junitInfo, $start, $stop - $start);
- if (is_numeric($result))
- {
- $junitFailures += $result;
- }
- else if (strcmp($result, "DNF") == 0)
- {
- $junitFailures++;
- }
- }
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">", $stop);
- }
- $compileStart = strpos($content, "Compile Logs (Jar Files)");
- $compileEnd = strpos($content, "</table>", $compileStart);
- $compileInfo = substr($content, $compileStart, $compileEnd - $compileStart);
- $rowStart = strpos($compileInfo, "<tr>");
- while ($rowStart !== false)
- {
- $start += 4;
- $rowStop = strpos($compileInfo, "</tr>", $rowStart);
- if ($rowStop !== false)
- {
- $row = substr($compileInfo, $rowStart, $rowStop - $rowStart);
- $cellStart = strpos($row, "<td");
- $gotError = false;
- $gotWarning = false;
- while ($cellStart !== false && (!$gotError || !$gotWarning))
- {
- // this parsing logic got a bit more complicated in M2_33 basebuild, as the
- // tag <td align="center"> was used, instead of <td>
- // $cellStart += 4;
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "</td>", $cellStart);
- if ($cellStop !== false)
- {
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- if (!$gotError)
- {
- $compileErrors += $cell;
- $gotError = true;
- }
- else if (!$gotWarning)
- {
- $compileWarnings += $cell;
- $gotWarning = true;
- }
- }
- }
- // this parsing logic got a bit more complicated in M2_33 basebuild, as the
- // tag <td align="center"> was used, instead of <td>
- $cellStart = strpos($row, "<td", $cellStop);
- }
- }
- $rowStart = strpos($compileInfo, "<tr>", $rowStop);
- }
- }
- }
- $results = array($compileErrors, $compileWarnings, $junitFailures);
- return $results;
- }
-
- function parse($filename, $key)
- {
- if (!is_readable($filename))
- {
- return 0;
- }
- $value;
- $handle = @fopen($filename, "r");
- if (!$handle)
- {
- return 0;
- }
- $size = filesize($filename);
- $content = fread($handle, $size);
- fclose($handle);
- $start = strpos($content, $key);
- while ($start !== false)
- {
- $start += strlen($key);
- $stop = strpos($content, "\"", $start);
- if ($stop !== false)
- {
- $value += substr($content, $start, $stop - $start);
- }
- $start = strpos($content, $key, $stop);
- }
- return $value;
- }
-?>
diff --git a/downloadsites/webtools/committers/report2.php b/downloadsites/webtools/committers/report2.php
deleted file mode 100644
index 0859c0d..0000000
--- a/downloadsites/webtools/committers/report2.php
+++ /dev/null
@@ -1,127 +0,0 @@
-
- <?php
-
-function parse2_testResults($filename)
-{
- $junitFailures = -1;
- if (is_file($filename)) {
- $handle = @fopen($filename, "r");
- if ($handle)
- {
- $junitFailures = 0;
- $size = filesize($filename);
- $content = fread($handle, $size);
- fclose($handle);
- $junitStart = strpos($content, "Errors & Failures");
- $junitEnd = strpos($content, "</table>", $junitStart);
- $junitInfo = substr($content, $junitStart, $junitEnd - $junitStart);
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">");
- while ($start !== false)
- {
- $start += 29;
- $stop = strpos($junitInfo, "</font></b></td>", $start);
- if ($stop !== false)
- {
- $result = substr($junitInfo, $start, $stop - $start);
- if (is_numeric($result))
- {
- $junitFailures += $result;
- }
- else if (strcmp($result, "DNF") == 0)
- {
- $junitFailures++;
- }
- }
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">", $stop);
- }
- $results = array($junitFailures);
- return $results;
- }
- }
-}
-
-function parse2_compileResults($filename)
-{
- $compileErrors = 0;
- $compileAccessWarnings = 0;
- $compileOtherWarnings = 0;
- if (is_file($filename)) {
- //echo "$filename<br />";
- $handle = @fopen($filename, "r");
- if ($handle)
- {
- $size = filesize($filename);
- //echo "size: $size<br />";
- $content = fread($handle, $size);
- fclose($handle);
-
- //echo "$content";
- $compileStart = strpos($content, "<table id=tabledata");
- $compileEnd = strpos($content, "</table", $compileStart);
- $compileInfo = substr($content, $compileStart, $compileEnd - $compileStart);
- //echo "compileInfo: $compileInfo<br />";
- $rowStart = strpos($compileInfo, "<tr>");
- $rowStart = strpos($compileInfo, "<tr>");
- $start = $rowStart+4;
- while ($rowStart !== false)
- {
-
- $start += 4;
- $rowStop = strpos($compileInfo, "</tr>", $rowStart);
- //if ($rowStop !== false)
- //{
- $row = substr($compileInfo, $rowStart, $rowStop - $rowStart);
- //echo "$row";
- //while ($cellStart !== false)
- //{
- // this parsing logic got a bit more complicated in M5_33 basebuild, as the
- // a whole different structure was used.
- // we'll try to quick fix this, but need our own index task
- $cellStart = strpos($row, "#ERROR");
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "<", $cellStart);
- if ($cellStop !== false)
- {
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- $compileErrors += $cell;
- }
- $cellStart = strpos($row, "#ACCESSRULES_WARNINGS");
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "<", $cellStart);
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- $compileAccessWarnings += $cell;
- }
- $cellStart = strpos($row, "#OTHER_WARNINGS");
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "<", $cellStart);
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- $compileOtherWarnings += $cell;
- }
- }
- // look for next row.
- //$cellStart = strpos($row, "<tr", $cellStop);
- //}
- //}
- $rowStart = strpos($compileInfo, "<tr>", $rowStop);
- }
- }
- }
-
- $results = array($compileErrors, $compileAccessWarnings, $compileOtherWarnings);
- return $results;
-}
-
-
-
-?>
-
-
diff --git a/downloadsites/webtools/compileLogSumaryXML.php b/downloadsites/webtools/compileLogSumaryXML.php
index 7b26255..0b47a3c 100644
--- a/downloadsites/webtools/compileLogSumaryXML.php
+++ b/downloadsites/webtools/compileLogSumaryXML.php
@@ -1,7 +1,7 @@
<?php
-$filename = "drops/$bValue/$innerValue/compilelogsSummary.xml";
+$filename = "$innerValue/compilelogsSummary.xml";
$prefixForVariable = "code_";
$compileSummary = simplexml_load_file($filename);
foreach ($compileSummary->summaryItem as $summaryItem) {
@@ -12,7 +12,7 @@
eval($code);
}
-$filename = "drops/$bValue/$innerValue/testcompilelogsSummary.xml";
+$filename = "$innerValue/testcompilelogsSummary.xml";
if (file_exists($filename)) {
$prefixForVariable = "test_";
$compileSummary = simplexml_load_file($filename);
@@ -30,7 +30,7 @@
$test_totaldiscouragedAccessWarningCount = 0;
}
-$filename = "drops/$bValue/$innerValue/unitTestsSummary.xml";
+$filename = "$innerValue/unitTestsSummary.xml";
if (file_exists("$filename")) {
$prefixForVariable = "unittest_";
$unitTestsSummary = simplexml_load_file($filename);
diff --git a/downloadsites/webtools/computeMainData.php b/downloadsites/webtools/computeMainData.php
index ef53472..3567329 100644
--- a/downloadsites/webtools/computeMainData.php
+++ b/downloadsites/webtools/computeMainData.php
@@ -1,135 +1,81 @@
<?php
-$buildBranches = array();
-$buildBranches[0]="R3.0";
-$buildBranches[1]="R2.0";
-$buildBranches[2]="R1.5";
-$buildBranches[3]="R1.0";
-$buildBranches[4]="R0.7";
-include 'report.php';
-include 'report2.php';
-$latestTimeStamp=array();
-$latestFile = array();
-$buckets = array();
-$timeStamps = array();
+
function computeMainData($buildBranches, $debugScript)
{
-
- global $buckets, $latestFile, $latestTimeStamp, $timeStamps;
- foreach ($buildBranches as $buildBranch ) {
+ global $buckets, $latestFile, $latestTimeStamp, $timeStamps;
- $aBranchDirectoryName = "drops/".$buildBranch;
- if (file_exists($aBranchDirectoryName) && is_dir($aBranchDirectoryName)) {
- $aDirectory = dir($aBranchDirectoryName);
- $latestTimeStamp[$buildBranch] = array();
- $latestFile[$buildBranch] = array();
+ foreach ($buildBranches as $buildBranch ) {
+
+ if (file_exists($buildBranch) && is_dir($buildBranch)) {
+ $aDirectory = dir($buildBranch);
+ $latestTimeStamp[$buildBranch] = array();
+ $latestFile[$buildBranch] = array();
- while (false !== ($anEntry = $aDirectory->read())) {
+ while (false !== ($anEntry = $aDirectory->read())) {
- // Short cut because we know aDirectory only contains other directories.
- if ($anEntry != "." && $anEntry!="..") {
+ // Short cut because we know aDirectory only contains other directories.
+ if ($anEntry != "." && $anEntry!="..") {
- // echo "Debug anEntry: $anEntry<br />" ;
- $aDropDirectoryName = "drops/".$buildBranch."/".$anEntry;
+ // echo "Debug anEntry: $anEntry<br />" ;
+ $aDropDirectoryName = $buildBranch."/".$anEntry;
- if (is_dir($aDropDirectoryName) && is_Readable($aDropDirectoryName)) {
- $aDropDirectory = dir($aDropDirectoryName);
- //echo "Debug aDropDirectory: $aDropDirectory->path <br />" ;
+ if (is_dir($aDropDirectoryName) && is_Readable($aDropDirectoryName)) {
+ $aDropDirectory = dir($aDropDirectoryName);
+ //echo "Debug aDropDirectory: $aDropDirectory->path <br />" ;
- $fileCount = 0;
- while ($aDropEntry = $aDropDirectory->read()) {
- // echo "Debug aDropEntry: $aDropEntry<br />" ;
- if ( (stristr($aDropEntry, ".tar.gz")) || (stristr($aDropEntry, ".zip")) ) {
- // Count the dropfile entry in the directory (so we won't display links, if not all there
- $fileCount = $fileCount + 1;
- }
- }
+ $fileCount = 0;
+ while ($aDropEntry = $aDropDirectory->read()) {
+ // echo "Debug aDropEntry: $aDropEntry<br />" ;
+ if ( (stristr($aDropEntry, ".tar.gz")) || (stristr($aDropEntry, ".zip")) ) {
+ // Count the dropfile entry in the directory (so we won't display links, if not all there
+ $fileCount = $fileCount + 1;
+ }
+ }
- $aDropDirectory->close();
+ $aDropDirectory->close();
- }
- // Read the count file
- $countFile = "drops/".$buildBranch."/".$anEntry."/files.count";
- $indexFile = "drops/".$buildBranch."/".$anEntry."/index.html";
+ }
+ // Read the count file
+ $countFile = $buildBranch."/".$anEntry."/files.count";
+ $indexFile = $buildBranch."/".$anEntry."/index.html";
- if (!file_exists($indexFile)) {
- $indexFile = "drops/".$buildBranch."/".$anEntry."/index.php";
- }
+ if (!file_exists($indexFile)) {
+ $indexFile = $buildBranch."/".$anEntry."/index.php";
+ }
- if (file_exists($countFile) && file_exists($indexFile)) {
- $anArray = file($countFile);
- // debug
- //echo "Number according to files.count: ", $anArray[0];
- //echo " actual counted files: ", $fileCount;
+ if (file_exists($countFile) && file_exists($indexFile)) {
+ $anArray = file($countFile);
+ // debug
+ //echo "Number according to files.count: ", $anArray[0];
+ //echo " actual counted files: ", $fileCount;
- // If a match - process the directoryVV -- we simply look that there's more
- // zip's than we expect, since it frequently breaks where the count is slighly
- // off, such as when we add, after the fact, an all-in-one zip.
- if ($anArray[0] <= $fileCount) {
- // debug
- //echo "yes, counted equaled expected count<br />";
+ // If a match - process the directoryVV -- we simply look that there's more
+ // zip's than we expect, since it frequently breaks where the count is slighly
+ // off, such as when we add, after the fact, an all-in-one zip.
+ if ($anArray[0] <= $fileCount) {
+ // debug
+ //echo "yes, counted equaled expected count<br />";
- $entryParts = explode("-", $anEntry);
- if (count($entryParts) == 3) {
- // debug
- //echo "yes, counted parts was 3<br />";
- $buildTypePart = $entryParts[0];
- $buckets[$buildBranch][$buildTypePart][] = $anEntry;
- if ($debugScript) {
- echo "Found: $buildBranch, $buildTypePart, $anEntry <br />";
- }
+ $artifactTimeStamp="";
+ $entryParts = explode("-", $anEntry);
+ if (count($entryParts) == 3) {
+ include 'processDropDirectory.php';
+ }
- $timePart = $entryParts[2];
- $year = substr($timePart, 0, 4);
- $month = substr($timePart, 4, 2);
- $day = substr($timePart, 6, 2);
- $hour = substr($timePart,8,2);
- $minute = substr($timePart,10,2);
+ }
+ }
- $newTimePart = "$year-$month-$day $hour:$minute UTC";
+ }
+ }
- $timeStamp = strtotime($newTimePart);
-
- $timeStamps[$anEntry] = gmdate("D, j M Y -- H:i \(\U\T\C\)", $timeStamp);
-
- // debug
- // echo "<br />buildBranch: $buildBranch <br />";
- // echo "<br />parts[0]: -$buildTypePart- <br />";
- // echo "latestTimeStamp[buildBranch]:";
- // echo $latestTimeStamp[$buildBranch];
- // echo "latestTimeStamp:";
- // echo $latestTimeStamp;
-
- if ((sizeof($latestTimeStamp[$buildBranch]) > 0) &&
- (isset($latestTimeStamp[$buildBranch][$buildTypePart])))
- {
- if ($timeStamp > $latestTimeStamp[$buildBranch][$buildTypePart])
- {
- $latestTimeStamp[$buildBranch][$buildTypePart] = $timeStamp;
- $latestFile[$buildBranch][$buildTypePart] = $anEntry;
- }
- }
- else
- {
- $latestTimeStamp[$buildBranch][$buildTypePart] = $timeStamp;
- $latestFile[$buildBranch][$buildTypePart] = $anEntry;
-
- }
- }
-
- }
- }
-
- }
- }
-
- $aDirectory->close();
- }}
+ $aDirectory->close();
+ }}
}
?>
diff --git a/downloadsites/webtools/downloads/buildbranches.php b/downloadsites/webtools/downloads/buildbranches.php
new file mode 100644
index 0000000..b055999
--- /dev/null
+++ b/downloadsites/webtools/downloads/buildbranches.php
@@ -0,0 +1,8 @@
+<?
+$buildBranches = array();
+$buildBranches[0]="drops/R3.0";
+$buildBranches[1]="drops/R2.0";
+$buildBranches[2]="drops/R1.5";
+$buildBranches[3]="drops/R1.0";
+$buildBranches[4]="drops/R0.7";
+?>
diff --git a/downloadsites/webtools/downloads/index.php b/downloadsites/webtools/downloads/index.php
index bd04bab..0096cda 100644
--- a/downloadsites/webtools/downloads/index.php
+++ b/downloadsites/webtools/downloads/index.php
@@ -59,6 +59,7 @@
<?php
+include 'buildbranches.php';
include '../topAndInit.php';
include '../latestBuilds.php';
include '../recentHistory.php';
diff --git a/downloadsites/webtools/downloads/report.php b/downloadsites/webtools/downloads/report.php
deleted file mode 100644
index 8266879..0000000
--- a/downloadsites/webtools/downloads/report.php
+++ /dev/null
@@ -1,147 +0,0 @@
-<?php
- function count_pattern($directory, $filenameFilter, $pattern)
- {
- $count = 0;
- $dir = dir($directory);
- while ($anEntry = $dir->read())
- {
- if ($anEntry != "." && $anEntry != "..")
- {
- $anEntry = $directory."/".$anEntry;
- if (is_dir($anEntry))
- {
- $count += count_pattern($anEntry, $filenameFilter, $pattern);
- }
- else
- {
- if (stristr($anEntry, $filenameFilter))
- {
- $handle = @fopen($anEntry, "r");
- if (FALSE !== $handle) {
- $size = filesize($anEntry);
- $content = fread($handle, $size);
- fclose($handle);
- $count += substr_count($content, $pattern);
- }
- }
- }
- }
- }
- return $count;
- }
-
- function parse_testResult($filename)
- {
- $junitFailures = 0;
- $compileErrors = 0;
- $compileWarnings = 0;
- if (is_file($filename)) {
- $handle = @fopen($filename, "r");
- if ($handle)
- {
- $size = filesize($filename);
- $content = fread($handle, $size);
- fclose($handle);
- $junitStart = strpos($content, "Errors & Failures");
- $junitEnd = strpos($content, "</table>", $junitStart);
- $junitInfo = substr($content, $junitStart, $junitEnd - $junitStart);
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">");
- while ($start !== false)
- {
- $start += 29;
- $stop = strpos($junitInfo, "</font></b></td>", $start);
- if ($stop !== false)
- {
- $result = substr($junitInfo, $start, $stop - $start);
- if (is_numeric($result))
- {
- $junitFailures += $result;
- }
- else if (strcmp($result, "DNF") == 0)
- {
- $junitFailures++;
- }
- }
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">", $stop);
- }
- $compileStart = strpos($content, "Compile Logs (Jar Files)");
- $compileEnd = strpos($content, "</table>", $compileStart);
- $compileInfo = substr($content, $compileStart, $compileEnd - $compileStart);
- $rowStart = strpos($compileInfo, "<tr>");
- while ($rowStart !== false)
- {
- $start += 4;
- $rowStop = strpos($compileInfo, "</tr>", $rowStart);
- if ($rowStop !== false)
- {
- $row = substr($compileInfo, $rowStart, $rowStop - $rowStart);
- $cellStart = strpos($row, "<td");
- $gotError = false;
- $gotWarning = false;
- while ($cellStart !== false && (!$gotError || !$gotWarning))
- {
- // this parsing logic got a bit more complicated in M2_33 basebuild, as the
- // tag <td align="center"> was used, instead of <td>
- // $cellStart += 4;
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "</td>", $cellStart);
- if ($cellStop !== false)
- {
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- if (!$gotError)
- {
- $compileErrors += $cell;
- $gotError = true;
- }
- else if (!$gotWarning)
- {
- $compileWarnings += $cell;
- $gotWarning = true;
- }
- }
- }
- // this parsing logic got a bit more complicated in M2_33 basebuild, as the
- // tag <td align="center"> was used, instead of <td>
- $cellStart = strpos($row, "<td", $cellStop);
- }
- }
- $rowStart = strpos($compileInfo, "<tr>", $rowStop);
- }
- }
- }
- $results = array($compileErrors, $compileWarnings, $junitFailures);
- return $results;
- }
-
- function parse($filename, $key)
- {
- if (!is_readable($filename))
- {
- return 0;
- }
- $value;
- $handle = @fopen($filename, "r");
- if (!$handle)
- {
- return 0;
- }
- $size = filesize($filename);
- $content = fread($handle, $size);
- fclose($handle);
- $start = strpos($content, $key);
- while ($start !== false)
- {
- $start += strlen($key);
- $stop = strpos($content, "\"", $start);
- if ($stop !== false)
- {
- $value += substr($content, $start, $stop - $start);
- }
- $start = strpos($content, $key, $stop);
- }
- return $value;
- }
-?>
diff --git a/downloadsites/webtools/downloads/report2.php b/downloadsites/webtools/downloads/report2.php
deleted file mode 100644
index 0859c0d..0000000
--- a/downloadsites/webtools/downloads/report2.php
+++ /dev/null
@@ -1,127 +0,0 @@
-
- <?php
-
-function parse2_testResults($filename)
-{
- $junitFailures = -1;
- if (is_file($filename)) {
- $handle = @fopen($filename, "r");
- if ($handle)
- {
- $junitFailures = 0;
- $size = filesize($filename);
- $content = fread($handle, $size);
- fclose($handle);
- $junitStart = strpos($content, "Errors & Failures");
- $junitEnd = strpos($content, "</table>", $junitStart);
- $junitInfo = substr($content, $junitStart, $junitEnd - $junitStart);
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">");
- while ($start !== false)
- {
- $start += 29;
- $stop = strpos($junitInfo, "</font></b></td>", $start);
- if ($stop !== false)
- {
- $result = substr($junitInfo, $start, $stop - $start);
- if (is_numeric($result))
- {
- $junitFailures += $result;
- }
- else if (strcmp($result, "DNF") == 0)
- {
- $junitFailures++;
- }
- }
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">", $stop);
- }
- $results = array($junitFailures);
- return $results;
- }
- }
-}
-
-function parse2_compileResults($filename)
-{
- $compileErrors = 0;
- $compileAccessWarnings = 0;
- $compileOtherWarnings = 0;
- if (is_file($filename)) {
- //echo "$filename<br />";
- $handle = @fopen($filename, "r");
- if ($handle)
- {
- $size = filesize($filename);
- //echo "size: $size<br />";
- $content = fread($handle, $size);
- fclose($handle);
-
- //echo "$content";
- $compileStart = strpos($content, "<table id=tabledata");
- $compileEnd = strpos($content, "</table", $compileStart);
- $compileInfo = substr($content, $compileStart, $compileEnd - $compileStart);
- //echo "compileInfo: $compileInfo<br />";
- $rowStart = strpos($compileInfo, "<tr>");
- $rowStart = strpos($compileInfo, "<tr>");
- $start = $rowStart+4;
- while ($rowStart !== false)
- {
-
- $start += 4;
- $rowStop = strpos($compileInfo, "</tr>", $rowStart);
- //if ($rowStop !== false)
- //{
- $row = substr($compileInfo, $rowStart, $rowStop - $rowStart);
- //echo "$row";
- //while ($cellStart !== false)
- //{
- // this parsing logic got a bit more complicated in M5_33 basebuild, as the
- // a whole different structure was used.
- // we'll try to quick fix this, but need our own index task
- $cellStart = strpos($row, "#ERROR");
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "<", $cellStart);
- if ($cellStop !== false)
- {
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- $compileErrors += $cell;
- }
- $cellStart = strpos($row, "#ACCESSRULES_WARNINGS");
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "<", $cellStart);
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- $compileAccessWarnings += $cell;
- }
- $cellStart = strpos($row, "#OTHER_WARNINGS");
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "<", $cellStart);
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- $compileOtherWarnings += $cell;
- }
- }
- // look for next row.
- //$cellStart = strpos($row, "<tr", $cellStop);
- //}
- //}
- $rowStart = strpos($compileInfo, "<tr>", $rowStop);
- }
- }
- }
-
- $results = array($compileErrors, $compileAccessWarnings, $compileOtherWarnings);
- return $results;
-}
-
-
-
-?>
-
-
diff --git a/downloadsites/webtools/handleSummaryResults.php b/downloadsites/webtools/handleSummaryResults.php
index c6aa7e1..10aa1a1 100644
--- a/downloadsites/webtools/handleSummaryResults.php
+++ b/downloadsites/webtools/handleSummaryResults.php
@@ -2,13 +2,13 @@
// if compilelogsSummary.xml exists, assume the "new way" (summary in xml file).
// else, assume old way
//echo "drops/$bValue/$innerValue/compilelogsSummary.xml";
-if (file_exists("drops/$bValue/$innerValue/compilelogsSummary.xml"))
+if (file_exists("$innerValue/compilelogsSummary.xml"))
{
include 'compileLogSumaryXML.php';
}
// if compileResults.php exists, assume the "new way" (testResults and compileResult seperated).
// else, assume old way
-else if (file_exists("drops/$bValue/$innerValue/compileResults.php"))
+else if (file_exists("$innerValue/compileResults.php"))
{
include 'parse2Handling.php';
}
diff --git a/downloadsites/webtools/latestBuilds.php b/downloadsites/webtools/latestBuilds.php
index 91d17b4..eb1b934 100644
--- a/downloadsites/webtools/latestBuilds.php
+++ b/downloadsites/webtools/latestBuilds.php
@@ -2,7 +2,9 @@
$debugLatest=false;
-include 'computeMainData.php';
+if (!function_exists("computeMainData")) {
+ include 'computeMainData.php';
+}
computeMainData($buildBranches, $debugLatest);
@@ -34,14 +36,15 @@
if (array_key_exists ($bValue, $latestFile) && array_key_exists($prefix, $latestFile[$bValue])) {
$fileName = $latestFile[$bValue][$prefix];
+ //echo "Debug: anEntry (filename) indexing timeStamps: ", $fileName, " <br />";
echo "<tr>";
echo "<td width=\"25%\">$value</td>";
$fileNameParts = explode("-", $fileName);
-
+
if (sizeof($fileNameParts) > 1) {
- echo "<td width=\"25%\"><a href=\"drops/$bValue/$fileName/\">$fileNameParts[1]</a></td>";
+ echo "<td width=\"25%\"><a href=\"$fileName/\">$fileNameParts[1]</a></td>";
echo "<td width=\"15%\">$bValue</td>";
echo "<td width=\"40%\">$timeStamps[$fileName]</td>";
echo "</tr>";
diff --git a/downloadsites/webtools/parse2Handling.php b/downloadsites/webtools/parse2Handling.php
index ee0c7c2..b841fee 100644
--- a/downloadsites/webtools/parse2Handling.php
+++ b/downloadsites/webtools/parse2Handling.php
@@ -1,5 +1,5 @@
<?php
-$testResults = parse2_testResults("drops/$bValue/$innerValue/testResults.php");
+$testResults = parse2_testResults("$innerValue/testResults.php");
list ($junitFailures) = $testResults;
$compileResults = parse2_compileResults("drops/$bValue/$innerValue/compileResults.php");
diff --git a/downloadsites/webtools/parseHandling.php b/downloadsites/webtools/parseHandling.php
index 33d2172..30f81b6 100644
--- a/downloadsites/webtools/parseHandling.php
+++ b/downloadsites/webtools/parseHandling.php
@@ -1,6 +1,6 @@
<?php
-$testResults = parse_testResult("drops/$bValue/$innerValue/testResults.php");
+$testResults = parse_testResult("$innerValue/testResults.php");
list ($compileErrors, $compileWarnings, $junitFailures) = $testResults;
echo "<td width=\"6%\"> </td>";
diff --git a/downloadsites/webtools/processDropDirectory.php b/downloadsites/webtools/processDropDirectory.php
new file mode 100644
index 0000000..a6ed2bc
--- /dev/null
+++ b/downloadsites/webtools/processDropDirectory.php
@@ -0,0 +1,48 @@
+<?php
+// echo "Debug: yes, counted parts was 3<br />";
+$buildTypePart = $entryParts[0];
+$buckets[$buildBranch][$buildTypePart][] = $aDropDirectoryName;
+// if ($debugScript) {
+//echo "Debug: Started processDropDirectory with following <br />";
+//echo " buildBranch: $buildBranch <br />";
+//echo " buildTypePart: $buildTypePart <br />";
+//echo " anEntry: $anEntry <br />";
+// }
+
+$timePart = $entryParts[2];
+$year = substr($timePart, 0, 4);
+$month = substr($timePart, 4, 2);
+$day = substr($timePart, 6, 2);
+$hour = substr($timePart,8,2);
+$minute = substr($timePart,10,2);
+
+$newTimePart = "$year-$month-$day $hour:$minute UTC";
+
+$timeStamp = strtotime($newTimePart);
+
+$timeStamps[$buildBranch."/".$artifactTimeStamp.$anEntry] = gmdate("D, j M Y -- H:i \(\U\T\C\)", $timeStamp);
+//echo "Debug: anEntry indexing timeStamps: ", $buildBranch."/".$artifactTimeStamp.$anEntry, "<br />";
+// debug
+// echo "<br />buildBranch: $buildBranch <br />";
+// echo "<br />parts[0]: -$buildTypePart- <br />";
+// echo "latestTimeStamp[buildBranch]:";
+// echo $latestTimeStamp[$buildBranch];
+// echo "latestTimeStamp:";
+// echo $latestTimeStamp;
+
+if ((sizeof($latestTimeStamp[$buildBranch]) > 0) &&
+(isset($latestTimeStamp[$buildBranch][$buildTypePart])))
+{
+ if ($timeStamp > $latestTimeStamp[$buildBranch][$buildTypePart])
+ {
+ $latestTimeStamp[$buildBranch][$buildTypePart] = $timeStamp;
+ $latestFile[$buildBranch][$buildTypePart] = $aDropDirectoryName;
+ }
+}
+else
+{
+ $latestTimeStamp[$buildBranch][$buildTypePart] = $timeStamp;
+ $latestFile[$buildBranch][$buildTypePart] = $aDropDirectoryName;
+
+}
+?>
\ No newline at end of file
diff --git a/downloadsites/webtools/recentHistory.php b/downloadsites/webtools/recentHistory.php
index 8017a22..461a313 100644
--- a/downloadsites/webtools/recentHistory.php
+++ b/downloadsites/webtools/recentHistory.php
@@ -106,12 +106,12 @@
}
*/
foreach($aBranchBucket as $innerValue) {
- if ($debugRecentHistory) {
- echo "innerValue: $innerValue <br />";
- }
+ //if ($debugRecentHistory) {
+ // echo "Debug recentHistory: innerValue: $innerValue <br />";
+ //}
$innerValueParts = explode("-", $innerValue);
echo "<tr>";
- echo "<td width=\"13%\"><a href=\"drops/$bValue/$innerValue/\">$innerValueParts[1]</a></td>";
+ echo "<td width=\"13%\"><a href=\"$innerValue/\">$innerValueParts[1]</a></td>";
echo "<td width=\"8%\">$bValue</td>";
echo "<td width=\"20%\">$timeStamps[$innerValue]</td>";
echo "<td> </td>";
diff --git a/downloadsites/webtools/report.php b/downloadsites/webtools/report.php
deleted file mode 100644
index 8266879..0000000
--- a/downloadsites/webtools/report.php
+++ /dev/null
@@ -1,147 +0,0 @@
-<?php
- function count_pattern($directory, $filenameFilter, $pattern)
- {
- $count = 0;
- $dir = dir($directory);
- while ($anEntry = $dir->read())
- {
- if ($anEntry != "." && $anEntry != "..")
- {
- $anEntry = $directory."/".$anEntry;
- if (is_dir($anEntry))
- {
- $count += count_pattern($anEntry, $filenameFilter, $pattern);
- }
- else
- {
- if (stristr($anEntry, $filenameFilter))
- {
- $handle = @fopen($anEntry, "r");
- if (FALSE !== $handle) {
- $size = filesize($anEntry);
- $content = fread($handle, $size);
- fclose($handle);
- $count += substr_count($content, $pattern);
- }
- }
- }
- }
- }
- return $count;
- }
-
- function parse_testResult($filename)
- {
- $junitFailures = 0;
- $compileErrors = 0;
- $compileWarnings = 0;
- if (is_file($filename)) {
- $handle = @fopen($filename, "r");
- if ($handle)
- {
- $size = filesize($filename);
- $content = fread($handle, $size);
- fclose($handle);
- $junitStart = strpos($content, "Errors & Failures");
- $junitEnd = strpos($content, "</table>", $junitStart);
- $junitInfo = substr($content, $junitStart, $junitEnd - $junitStart);
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">");
- while ($start !== false)
- {
- $start += 29;
- $stop = strpos($junitInfo, "</font></b></td>", $start);
- if ($stop !== false)
- {
- $result = substr($junitInfo, $start, $stop - $start);
- if (is_numeric($result))
- {
- $junitFailures += $result;
- }
- else if (strcmp($result, "DNF") == 0)
- {
- $junitFailures++;
- }
- }
- $start = strpos($junitInfo, "<td><b><font color=\"#ff0000\">", $stop);
- }
- $compileStart = strpos($content, "Compile Logs (Jar Files)");
- $compileEnd = strpos($content, "</table>", $compileStart);
- $compileInfo = substr($content, $compileStart, $compileEnd - $compileStart);
- $rowStart = strpos($compileInfo, "<tr>");
- while ($rowStart !== false)
- {
- $start += 4;
- $rowStop = strpos($compileInfo, "</tr>", $rowStart);
- if ($rowStop !== false)
- {
- $row = substr($compileInfo, $rowStart, $rowStop - $rowStart);
- $cellStart = strpos($row, "<td");
- $gotError = false;
- $gotWarning = false;
- while ($cellStart !== false && (!$gotError || !$gotWarning))
- {
- // this parsing logic got a bit more complicated in M2_33 basebuild, as the
- // tag <td align="center"> was used, instead of <td>
- // $cellStart += 4;
- $cellStart = strpos($row, ">", $cellStart);
- $cellStart = $cellStart + 1;
- $cellStop = strpos($row, "</td>", $cellStart);
- if ($cellStop !== false)
- {
- $cell = substr($row, $cellStart, $cellStop - $cellStart);
- if (is_numeric($cell))
- {
- if (!$gotError)
- {
- $compileErrors += $cell;
- $gotError = true;
- }
- else if (!$gotWarning)
- {
- $compileWarnings += $cell;
- $gotWarning = true;
- }
- }
- }
- // this parsing logic got a bit more complicated in M2_33 basebuild, as the
- // tag <td align="center"> was used, instead of <td>
- $cellStart = strpos($row, "<td", $cellStop);
- }
- }
- $rowStart = strpos($compileInfo, "<tr>", $rowStop);
- }
- }
- }
- $results = array($compileErrors, $compileWarnings, $junitFailures);
- return $results;
- }
-
- function parse($filename, $key)
- {
- if (!is_readable($filename))
- {
- return 0;
- }
- $value;
- $handle = @fopen($filename, "r");
- if (!$handle)
- {
- return 0;
- }
- $size = filesize($filename);
- $content = fread($handle, $size);
- fclose($handle);
- $start = strpos($content, $key);
- while ($start !== false)
- {
- $start += strlen($key);
- $stop = strpos($content, "\"", $start);
- if ($stop !== false)
- {
- $value += substr($content, $start, $stop - $start);
- }
- $start = strpos($content, $key, $stop);
- }
- return $value;
- }
-?>
diff --git a/downloadsites/webtools/topAndInit.php b/downloadsites/webtools/topAndInit.php
index 08a251f..f86d168 100644
--- a/downloadsites/webtools/topAndInit.php
+++ b/downloadsites/webtools/topAndInit.php
@@ -57,5 +57,12 @@
}
+include 'report.php';
+include 'report2.php';
+$latestTimeStamp=array();
+$latestFile = array();
+$buckets = array();
+$timeStamps = array();
+
?>