From: Francois Gouget Subject: [Tools 1/2] winetest/dissect: Simplify handling of $tag. Message-Id: Date: Wed, 22 Mar 2017 01:07:02 +0100 (CET) We don't want the leading underscore except in one place. Signed-off-by: Francois Gouget --- 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) : ""; + my $label = $tag ? $tag : ""; if (!$opt_update) { my $errdir = tempdir ("errXXXXX", DIR => $queuedir); if (!rename $tmpdir, $errdir) { @@ -132,15 +132,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/^ //) { @@ -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