From: Christian Franke <Christian.Franke@t-online.de>
To: cygwin-apps@cygwin.com
Subject: Re: [PATCH cygport] Add customization support for announce command
Date: Tue, 30 Apr 2024 12:27:35 +0200 [thread overview]
Message-ID: <83629cb5-9807-f20c-c8e5-0deff7d8236c@t-online.de> (raw)
In-Reply-To: <fe40c88b-ce71-444b-a35a-baa5aeb9a833@dronecode.org.uk>
Jon Turney wrote:
> On 10/03/2024 16:33, Christian Franke via Cygwin-apps wrote:
>> Jon Turney wrote:
>>> On 23/02/2024 11:23, Christian Franke via Cygwin-apps wrote:
>>>> Christian Franke wrote:
>>>>> The email generated by the cygport announce command is useful, but
>>>>> actual use cases are somewhat limited due to the hard-coded email
>>>>> submission.
>>>>>
>>>>> The attached patch adds more flexibility. The patch is on top of
>>>>> the "Use correct wording if only one package is announced" patch.
>>>>
>>>> Slightly changed patch attached. Also adjusted to new version of
>>>> "Use correct wording if only one package is announced" patch.
>>>>
>>>>
>>> [...]
>>>
>>> Thanks for this.
>>>
>>>> Possible (better?) alternative names for the new settings:
>>>> ANNOUNCEMENT_EDITOR
>>>> ANNOUNCEMENT_MAILER
>>>
>>> Hmmm... I think "ANNOUNCE_EDITOR" and "ANNOUNCE_MAILER" would be
>>> the best for clarity and conciseness.
>>
>> New patch attached. Is still on top of "Use correct wording ..." patch.
>>
>> I also added HOMEPAGE to the propagated variables as this should be
>> included in an announcement.
>
> Thanks.
>
>> + /bin/bash -c "cd ${top} || exit 1
>> +${HOMEPAGE+HOMEPAGE=${HOMEPAGE@Q}}
>> +P=${P@Q}; PF=${PF@Q}; PN=${PN@Q}; PR=${PR@Q}; PV=(${PV[*]@Q})
>> +${SMTP_SENDER+SMTP_SENDER=${SMTP_SENDER@Q}}
>> +${SMTP_SERVER+SMTP_SERVER=${SMTP_SERVER@Q}}
>> +${SMTP_SERVER_PORT+SMTP_SERVER_PORT=${SMTP_SERVER_PORT@Q}}
>> +${SMTP_ENCRYPTION+SMTP_ENCRYPTION=${SMTP_ENCRYPTION@Q}}
>> +${SMTP_USER+SMTP_USER=${SMTP_USER@Q}}
>> +${SMTP_PASS+SMTP_PASS=${SMTP_PASS@Q}}
>> +${cmd}
>> +" $0 ${msg} || error "Command '\${${cmdvar}} ${msg}'
>> (cwd=${top}) failed"
>> +}
>
> Sorry I didn't notice this before, and I am terrible at writing shell,
> but perhaps you could share the reasoning behind writing this as
> above, and not as, e.g.
>
> (cd ${top} && env BLAH ${cmd})
>
> avoiding all the verbiage in the description of ANNOUNCE_EDITOR about
> it being fed into 'bash -c' (and hence getting evaluated twice??)
> rather than just run?
>
>
None of the mentioned variables are exported to the environment by
cygport. I wanted to keep this fact in the subshell. Therefore the
assignments are added to the script instead of passing via
env(ironment). The latter won't even work with the PV variable because
arrays could not be exported.
Variables would not be evaluated twice. For example in the rare case
that someone uses something like
SMTP_SERVER="smtp.$(hostname -d)"
in cygport.conf, this would immediately expand to
SMTP_SERVER="smtp.some.domain". The above
${SMTP_SERVER+SMTP_SERVER=${SMTP_SERVER@Q}}
would expand to
SMTP_SERVER=${SMTP_SERVER@Q}
and then to
SMTP_SERVER='smtp.some.domain'
(The @Q bash extension ensures proper quoting).
next prev parent reply other threads:[~2024-04-30 10:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-21 14:52 Christian Franke
2024-02-23 11:23 ` Christian Franke
2024-03-10 14:37 ` Jon Turney
2024-03-10 16:33 ` Christian Franke
2024-04-29 19:37 ` Jon Turney
2024-04-30 10:27 ` Christian Franke [this message]
2024-05-01 12:50 ` Adam Dinwoodie
2024-05-01 14:49 ` Christian Franke
2024-05-01 21:00 ` Adam Dinwoodie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83629cb5-9807-f20c-c8e5-0deff7d8236c@t-online.de \
--to=christian.franke@t-online.de \
--cc=cygwin-apps@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).