]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Simplify the configure cache file format.
authorPeter Powell <petpow@saberuk.com>
Tue, 22 Mar 2016 23:21:24 +0000 (23:21 +0000)
committerPeter Powell <petpow@saberuk.com>
Tue, 22 Mar 2016 23:39:14 +0000 (23:39 +0000)
This prevents the need to implement escaping of values which was
a bug in the previous format.

make/configure.pm

index db9c42eb95deb9d7386daf38ca7b6171e053f26e..ee96e3c6973ec26fcd8d4d0d9a5006cca1cccb48 100644 (file)
@@ -220,7 +220,7 @@ sub read_configure_cache {
        open(CACHE, CONFIGURE_CACHE_FILE) or return %config;
        while (my $line = <CACHE>) {
                next if $line =~ /^\s*($|\#)/;
-               my ($key, $value) = ($line =~ /^(\S+)="(.*)"$/);
+               my ($key, $value) = ($line =~ /^(\S+)(?:\s(.+))?$/);
                $config{$key} = $value;
        }
        close(CACHE);
@@ -238,7 +238,7 @@ sub write_configure_cache(%) {
        open(CACHE, '>', CONFIGURE_CACHE_FILE) or print_error "unable to write ${\CONFIGURE_CACHE_FILE}: $!";
        while (my ($key, $value) = each %config) {
                $value //= '';
-               say CACHE "$key=\"$value\"";
+               say CACHE "$key $value";
        }
        close(CACHE);
 }