From cf17be6d97df34e993c8c1ab07f74ce1a8574714 Mon Sep 17 00:00:00 2001 From: "H.Merijn Brand - Tux" Date: Sun, 10 Feb 2013 20:45:29 +0100 Subject: [PATCH] Deal with spaces in patch descriptions To be sure, I also allowed "Compile time options" to have spaces Using \0 as a new separator seems a sane choice, as the values returned from internal functions are pure C strings, so they end with \0 patches can have spaces: # $got->{build}{patches}[0] = 'SAVEARGV0' # $expected->{build}{patches}[0] = 'SAVEARGV0 - disable magic open in ' # $got->{build}{patches}[0] = 'ActivePerl' # $expected->{build}{patches}[0] = 'ActivePerl Build 1602 [296513]' # $got->{build}{patches}[0] = 'DEBPKG:debian/arm_thread_stress_timeout' # $expected->{build}{patches}[0] = 'DEBPKG:debian/arm_thread_stress_timeout - http://bugs.debian.org/501970 Raise the timeout of ext/threads/shared/t/stress.t to accommodate slower build hosts' # $got->{build}{patches}[0] = 'Bug#55162' # $expected->{build}{patches}[0] = 'Bug#55162 File::Spec::case_tolerant performance' --- Changelog | 3 +++ V.pm | 20 ++++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Changelog b/Changelog index 5d1157a..e8fd425 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +0.17 - 10 Feb 2013, H.Merijn Brand + * Deal with spaces in patch descriptions + 0.16 - 25 Jan 2013, H.Merijn Brand * Do not shell out on 5.14.0 and up if perl provides internals (Nicholas) * Update copyright to 2013 diff --git a/V.pm b/V.pm index d70ed81..fa5aa48 100644 --- a/V.pm +++ b/V.pm @@ -303,14 +303,18 @@ sub myconfig #y $pv = qx[$^X -e"sub Config::myconfig{};" -V]; my $pv = qx[$^X -V]; $pv =~ s{.*?\n\n}{}s; - $pv =~ s{\n(?: \s+|\t\s*)}{ }g; - - #print $pv; - - $pv =~ m{^\s+Built under (.*)}m and $build->{osname} = $1; - $pv =~ m{^\s+Compiled at (.*)}m and $build->{stamp} = $1; - $pv =~ m{^\s+Locally applied patches:\s+(.*)}m and $build->{patches} = [ split m/\s+/, $1 ]; - $pv =~ m{^\s+Compile-time options:\s+(.*)}m and map { $build->{options}{$_} = 1 } split m/\s+/, $1; + $pv =~ s{\n(?: \s+|\t\s*)}{\0}g; + + # print STDERR $pv; + + $pv =~ m{^\s+Built under\s+(.*)}m + and $build->{osname} = $1; + $pv =~ m{^\s+Compiled at\s+(.*)}m + and $build->{stamp} = $1; + $pv =~ m{^\s+Locally applied patches:(?:\s+|\0)(.*)}m + and $build->{patches} = [ split m/\0+/, $1 ]; + $pv =~ m{^\s+Compile-time options:(?:\s+|\0)(.*)}m + and map { $build->{options}{$_} = 1 } split m/\s+|\0/ => $1; } my @KEYS = keys %ENV; -- 2.11.4.GIT