[aur-dev][PATCH] config: allow reading both the proto file and the modified config

Nodiv Byzero nodivbyzero at gmail.com
Thu Apr 12 18:22:52 UTC 2018


The point is that there are few places where config_load() gets called
in the sequential order (the same request) and every time it loads and
parses data.

On Thu, Apr 12, 2018 at 11:05 AM, Eli Schwartz <eschwartz at archlinux.org> wrote:
> On 04/12/2018 01:51 PM, Nodiv Byzero wrote:
>> What do you think about adding one more line to check if $config is already set?
>> Something like:
>>  if (!isset($config)) {
>>   ... do the parse_ini_file
>>  }
>>
>> Just to reduce disk operations.
>
> What is the point? We only check if $AUR_CONFIG isset() because it is
> explicitly global, and the function is here to set it if needed or else
> do nothing.
>
> $config is locally scoped, and its only purpose is exactly where it is
> being used. It should be utterly impossible for it to be set beforehand.
>
> ...
>
> On an unrelated note, Bluewind suggested renaming the config.proto to
> config.defaults, so if Lukas agrees with this patch I will send in an
> amended version.
>
> --
> Eli Schwartz
> Bug Wrangler and Trusted User
>


More information about the aur-dev mailing list