persistence: Fix regression in saving options.

The move to JSON storage of persistent opts break first-time users,
since the refactored code never actually gets around to setting a
persistent_options key in the build context object.

This seemed to work previously with Data::Dumper, but JSON::PP is not
happy with being asked to serialize an undef.  On the other hand I had
always thought that sub setPersistentOption would have 'autovivified'
the needed hash table, and the reporter's build process should have
resulted in many calls to setPersistentOption over the build.

BUG:388180
FIXED-IN:18.01
wilder
Michael Pyne 8 years ago
parent fdbaaaa548
commit 25e7bfc26f
  1. 2
      modules/ksb/BuildContext.pm

@ -153,6 +153,7 @@ sub new
rcFiles => [@rcfiles],
rcFile => undef,
env => { },
persistent_options => { } # These are kept across multiple script runs
ignore_list => [ ], # List of KDE project paths to ignore completely
kde_projects_metadata => undef, # Enumeration of kde-projects
kde_dependencies_metadata => undef, # Dependency resolution of kde-projects
@ -827,7 +828,6 @@ sub storePersistentOptions
}
my $encodedJSON = $json->encode($self->{persistent_options});
print $fh $encodedJSON;
undef $fh; # Closes the file
}

Loading…
Cancel
Save