From: Francois Gouget Subject: [Tools v2 1/2] winetest/dissect: Simplify handling of $tag. Message-Id: <94abec4edd19970c2d8dfdec72a1d268bf4fbb11.1490270424.git.fgouget@codeweavers.com> Date: Thu, 23 Mar 2017 13:02:10 +0100 (CET) We don't want the leading underscore except in one place. Signed-off-by: Francois Gouget --- v1 depended on a patch I use to simplify testing here but which is not quite ready for submission yet. winetest/dissect | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/winetest/dissect b/winetest/dissect index c2c453c..c6b4b71 100755 --- a/winetest/dissect +++ b/winetest/dissect @@ -73,7 +73,7 @@ sub mydie(@) { print STDERR "$name0:error: unable to rename '$tmpdir' to '$errdir': $!\n"; exit 3; } - my $label = $tag ? substr($tag, 1) : ""; + my $label = $tag ? $tag : ""; if (open ERR, ">$errdir/error") { print ERR "$label: ", @_; @@ -123,15 +123,15 @@ $_ = ; if (/^Archive: /) { $_ = ; } # ignore Archive header /^Tag: ([-.0-9a-zA-Z]*)\r?$/ or mydie "no tag line: $_"; -$tag = $1 eq ""?"":"_$1"; +$tag = $1; $_ = ; /^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} .= "

Build version

\n"; $box->{data} .= "\n"; $box->{data} .= sprintf "\n", $testbuild, $testbuild, $shortbuild; -$box->{data} .= sprintf "
Build%s
Tag%s
\n", substr($tag,1); +$box->{data} .= "Tag$tag\n"; $box->{data} .= sprintf "
\n"; while (($_ = ) =~ s/^ //) { @@ -464,7 +464,7 @@ foreach ($datadir, $builddir) { } 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