Re: [mh] collections.json being changed on $Pgm_Root?
H Plato <[email protected]>
| Newsgroups | gmane.comp.misc.misterhouse.user |
|---|---|
| Message-ID | <[email protected]> |
Reading & writing have this order of preference
my $prefs_file = "$Pgm_Root/data/web/ia7_config.json";
$prefs_file = "$config_parms{data_dir}/web/ia7_config.json"
if -e "$config_parms{data_dir}/web/ia7_config.json";
$prefs_file = "$config_parms{ia7_data_dir}/ia7_config.json"
if -e "$config_parms{ia7_data_dir}/ia7_config.json”;
1st priority is if someone actually set a specific config.ini ia7_data_dir, then if there is a custom data_dir, lastly use the stock file.
The upgrader adds specific functionality to all the file locations. Some versions of IA7 need certain collection.json items, so I thought it would be safest to ensure that any files in those locations are up to date.
Am I missing something?
> On Dec 11, 2018, at 2:36 PM, Eloy Paris <[email protected]> wrote:
>
> Hi Howard,
>
> Question on collections.json...
>
> I set data_dir in my .ini file to avoid writing to $Pgm_Root/data. That
> way git never finds a modified file in $Pgm_Root/data and I keep the
> source code tree separate from the data (I'm guessing this is how
> everybody does it).
>
> I just found out that ia7_update_collection() in lib/ia7_utilities.pl
> will update all collections.json files in all locations
> ($Pgm_Root/data/web/, $config_parms{data_dir}/web/, and
> $config_parms{ia7_data_dir}/).
>
> However, when reading the file, we seem to use the order
> $config_parms{data_dir}/web/, $config_parms{ia7_data_dir}/, and
> $Pgm_Root/data/web/, and stop with the first one we find.
>
> (And similar for writing in json_write_file() -- we write to the first
> we find and then stop.)
>
> Is there any reason for updating the same file in all locations,
> especially the one at $Pgm_Root/data/web/ (which will throw git off);
> should we just no update the first one we find?
>
> Cheers,
>
> Eloy Paris.-
>
>
>
> ________________________________________________________
> To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users