Alexandre Julliard : winetest: Enforce that the build id is a valid commit SHA1.

Alexandre Julliard julliard at winehq.org
Tue May 27 11:18:35 CDT 2008


Module: tools
Branch: master
Commit: d6dc27434f5d1b480be3238ca525d6ed766571e9
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=d6dc27434f5d1b480be3238ca525d6ed766571e9

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue May 27 18:15:55 2008 +0200

winetest: Enforce that the build id is a valid commit SHA1.

Get rid of the winetest.builds file.

---

 winetest/README        |    8 +-------
 winetest/dissect       |   22 ++++++++--------------
 winetest/service.cgi   |    1 -
 winetest/winetest.conf |    1 -
 4 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/winetest/README b/winetest/README
index 2a0215d..49ca6d0 100644
--- a/winetest/README
+++ b/winetest/README
@@ -14,7 +14,6 @@ the destination for that and presents the results in an ordered form.
 Configuration file, sets the following variables:
 $queuedir - queue incoming submissions here
 $datadir  - processed data is served from here
-$builds   - list of allowed build tags
 
 * winetest.cgi
 
@@ -35,8 +34,7 @@ at processing this report.  If everything goes flawlessly the whole
 directory is renamed (based on the information learned in the process)
 to $datadir/BUILD/VERSION_TAG_DIGIT where DIGIT is for resolving name
 clashes and $datadir/BUILD/outdated is created to signal the change in
-the given build.  Allowed builds are those in $builds.  See also the
-head of the file.
+the given build.  See also the head of the file.
 
 * gather
 
@@ -50,9 +48,5 @@ removes the outdated file.  See also the head of the file.
 
 These files are referenced by the index.html files created by gather.
 
-* winetest.builds
-
-The file to have $builds point to.
-
 
 Ferenc Wagner <wferi at afavant.elte.hu>, Wed, 18 Jan 2004 18:18:05 +0100
diff --git a/winetest/dissect b/winetest/dissect
index 6293c1c..bbfe982 100755
--- a/winetest/dissect
+++ b/winetest/dissect
@@ -2,8 +2,7 @@
 #
 # Searches for $queuedir/rep*/report.txt-s, preprocesses and moves
 # them into the appropriate $datadir/build/version directories, and
-# creates $datadir/build/outdated.  Allowed builds are read from
-# $builds.  Each generated file has .txt extension.
+# creates $datadir/build/outdated. Each generated file has .txt extension.
 #
 # Files: winetest.conf
 #
@@ -29,7 +28,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 use strict;
-use vars qw/$builds $queuedir $datadir $maxmult $maxfilesize/;
+use vars qw/$gitdir $queuedir $datadir $maxmult $maxfilesize/;
 require "winetest.conf";
 
 my $name0=$0;
@@ -44,6 +43,8 @@ my $summary_version=4;
 use File::Temp qw/tempdir/;
 use Errno qw/ENOTEMPTY/;
 
+$ENV{GIT_DIR} = $gitdir;
+
 my ($report, $tmpdir);
 
 sub mydie(@) {
@@ -76,17 +77,10 @@ print SUM "Version $summary_version\n";
 $_ = <IN>;
 /^Tests from build ([-.0-9a-zA-Z]+)\r?$/ or mydie "no build header: $_";
 my $testbuild = $1;
-if (!open BUILDS, "<$builds") {
-    print STDERR "$name0:error: unable to open '$builds' for reading: $!\n";
-    exit 3;
-}
-while (<BUILDS>) {
-    next if /^#/;
-    chomp;
-    last if $testbuild =~ "^$_\$";
-}
-close BUILDS;
-defined $_ or mydie "$1 not in $builds\n";
+$testbuild =~ /^[0-9a-f]{40}$/ or mydie "not a valid commit id $testbuild";
+my $commit = `git rev-parse --verify $testbuild^0 2>/dev/null`;
+chomp $commit;
+$testbuild eq $commit or mydie "not an existing commit $testbuild";
 
 $_ = <IN>;
 /^Archive: (.*?)\r?$/ or mydie "no archive line: $_";
diff --git a/winetest/service.cgi b/winetest/service.cgi
index 14c79b7..9f34633 100755
--- a/winetest/service.cgi
+++ b/winetest/service.cgi
@@ -210,7 +210,6 @@ sub releases_make {
     # all is good, store the cookie, and URL now, this activetes the release
     &write_file(">$base_path/$name.cookie", &md5sum($cookie));
     &write_file(">$base_path/$name.url", $url);
-    &write_file(">>$data_root/$program.builds", $build);
 
     return "OK";
 }
diff --git a/winetest/winetest.conf b/winetest/winetest.conf
index e1b0297..b240ac0 100644
--- a/winetest/winetest.conf
+++ b/winetest/winetest.conf
@@ -1,7 +1,6 @@
 # Hey Emacs! This is a -*-cperl-*- file!
 
 $root = "/home/winehq/opt/winetest";
-$builds = "$root/winetest.builds";
 # These two below should be on the same filesystem
 $queuedir = "$root/queue";
 $datadir  = "$root/data";




More information about the wine-cvs mailing list