[Tools 1/2] winetest/dissect: Simplify handling of $tag.

Francois Gouget fgouget at codeweavers.com
Tue Mar 21 19:07:02 CDT 2017


We don't want the leading underscore except in one place.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 winetest/dissect | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/winetest/dissect b/winetest/dissect
index c98fd75..bd34daa 100755
--- a/winetest/dissect
+++ b/winetest/dissect
@@ -69,7 +69,7 @@ my ($opt_update, $tmpdir, $tag);
 
 sub mydie(@)
 {
-    my $label = $tag ? substr($tag, 1) : "<notag>";
+    my $label = $tag ? $tag : "<notag>";
     if (!$opt_update) {
         my $errdir = tempdir ("errXXXXX", DIR => $queuedir);
         if (!rename $tmpdir, $errdir) {
@@ -132,15 +132,15 @@ $_ = <IN>;
 if (/^Archive: /) { $_ = <IN>; }  # ignore Archive header
 
 /^Tag: ([-.0-9a-zA-Z]*)\r?$/ or mydie "no tag line: $_";
-$tag = $1 eq ""?"":"_$1";
+$tag = $1;
 
 $_ = <IN>;
 /^Build info:\r?$/ or mydie "no Build info header: $_";
-my $box = create_box( "version", "version", sprintf "Version information for %s", substr($tag,1) );
+my $box = create_box( "version", "version", "Version information for $tag" );
 $box->{data} .= "<h2>Build version</h2>\n";
 $box->{data} .= "<table class=\"output\">\n";
 $box->{data} .= sprintf "<tr><td>Build</td><td><a title=\"%s\" href=\"$gitweb/?a=shortlog;h=%s\">%s</a></td></tr>\n", $testbuild, $testbuild, $shortbuild;
-$box->{data} .= sprintf "<tr><td>Tag</td><td><a title=\"Full report\" href=\"report.html\">%s</a></td></tr></table>\n", substr($tag,1);
+$box->{data} .= "<tr><td>Tag</td><td><a title=\"Full report\" href=\"report.html\">$tag</a></td></tr></table>\n";
 $box->{data} .= sprintf "<div class=\"output\"> </div>\n";
 while (($_ = <IN>) =~ s/^    //)
 {
@@ -474,7 +474,7 @@ if (!$opt_update) {
     }
 
     my ($dir, $dirbase, $try);
-    $dir = $dirbase = "$builddir/$version$tag";
+    $dir = $dirbase = "$builddir/${version}_$tag";
     $try = 0;
     while (!rename $tmpdir, $dir) {
         $!{ENOTEMPTY} or mydie "unable to rename '$tmpdir' to '$dir': $!\n";
-- 
2.11.0




More information about the wine-patches mailing list