[135005] trunk/dports/x11/xinit/Portfile

Mihai Moldovan ionic at macports.org
Mon Apr 13 08:27:10 PDT 2015


On 13.04.2015 05:15 PM, Rainer Müller wrote:
> On 2015-04-13 17:01, Lawrence Velázquez wrote:
>> On Apr 13, 2015, at 10:38 AM, Mihai Moldovan <ionic at macports.org> wrote:
>>
>>> The "problem" is that this is not a real "block" but a list element.
>>> While a newline at the beginning is generally ignored by the notes base
>>> code, newlines at the end are not. Not escaping a newline there is thus
>>> leading to output like this:
>>>
>>> "xinit has the following notes:
>>>  To choose MacPorts' X11 as the default server, you must install
>>> xorg-server,
>>>
>>>  logout, and log back in.
>>>
>>> "
>>
>> That's not the only problem with xinit's notes — they're entirely broken. Each "notes-append" you do creates its own separate block of text that the notes code formats/wraps individually.
> 
> The special handling is only implemented for the set command and it is
> only applied after the concatenation. The result is written back into
> the variable.
> 
> Maybe it would be better to do the transformation only when reading the
> option?
> 
> https://trac.macports.org/browser/trunk/base/src/port1.0/portutil.tcl?rev=134838#L519

Hmm, regarding this.

# Strip trailing empty lines
if {[string index $arg 0] eq "\n"} {
    set arg [string range $arg 1 end]
}
if {[string index $arg end] eq "\n"} {
    set arg [string range $arg 0 end-1]
}

So the code is already stripping newlines at the end.

But the end-stripping code should be moved to *after* indent removal?

Or else it won't be removed, because the last line isn't empty but also
including (indenting) whitespace which is the problem I worked around in
the xinit Portfile.



Mihai

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <https://lists.macosforge.org/pipermail/macports-dev/attachments/20150413/0ac7a088/attachment.sig>


More information about the macports-dev mailing list