Re: [PATCH 1/2] doc: replace use of environment variables with a generated config

Subject: Re: [PATCH 1/2] doc: replace use of environment variables with a generated config

Date: Tue, 14 Jul 2020 23:43:50 +0200

To: Tomi Ollila, David Bremner, notmuch@notmuchmail.org

Cc: David Bremner

From: Floris Bruynooghe


On Sat 11 Jul 2020 at 17:00 +0300, Tomi Ollila wrote:

> On Sat, Jul 11 2020, David Bremner wrote:
>
>> I don't love the use of exec, but it is getting unwieldy to pass
>> configuration options on the sphinx-build command line, and I
>> anticipate further use of conditionals.
>
> Perhaps less "opinions" in commit message.
>
> (and as I think I don't comment 2/2, s/seperate/separate/ there)
>
>
>> ---
>>  configure          |  8 ++++++++
>>  doc/Makefile.local |  2 +-
>>  doc/conf.py        | 11 ++++++++---
>>  3 files changed, 17 insertions(+), 4 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 80cbac4f..177432db 100755
>> --- a/configure
>> +++ b/configure
>> @@ -1548,6 +1548,14 @@ NOTMUCH_HAVE_PYTHON3_PYTEST=${have_python3_pytest}
>>  PLATFORM=${platform}
>>  EOF
>>  
>> +cat > sphinx.config <<EOF
>> +# Generate by configure, run from doc/conf.py
>> +EOF
>> +if [ $WITH_EMACS = "1" ]; then
>> +    printf "tags.add('WITH_EMACS')\n" >> sphinx.config
>> +fi
>> +printf "rsti_dir = '%s'\n" $(realpath emacs) >> sphinx.config
>> +
>
> perhaps instead of multiple redirections to the file, 
>
> {
>     echo "# Generated by configure, run from doc/conf.py"
>     echo
>     if [ $WITH_EMACS = "1" ]; then
>         printf "tags.add('WITH_EMACS')\n"
>     fi 
>     printf "rsti_dir = '%s'\n" "$(realpath emacs)"
>
> } > sphinx.config
>     
> alternative (someone might think less readable... ;/):
>
>  exec 3>&1 1> sphinx.config
>
>  echo "# Generated by configure, run from doc/conf.py"
>  ...
>
>  exec 1>&3 3>&-

I'd probably prefer this last one, but I don't mind any of the solutions or
even the current one.
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: