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 <io...@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
signature.asc
Description: OpenPGP digital signature
_______________________________________________ macports-dev mailing list macports-dev@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/macports-dev