[RFC] A trivial change for DESKTOP_ENTRIES (take 2)

Scot Hetzel swhetzel at gmail.com
Fri Jul 15 17:57:35 UTC 2011


2011/7/15 Warren Block <wblock at wonkity.com>:
>> How about something like this:
>>
>> http://www.freebsd.org/cgi/query-pr.cgi?pr=158936
>
> Wouldn't the point of using a separate filename argument be to let the user
> specify exactly what the name is?  Here you end up with the same
> system-processed filename.  Possibly I've misunderstood.
>
The system-processed filename could be simplified for the
DESKTOP_ENTRIESv2 in install-desktop-entries to just

   filename="$$1"

But then we would still need to add a check to check-desktop-entries
for DESKTOP_ENTRIESv2 that would detect illegal characters in the
filename.

> Apart from whether it's necessary, making the filename the last field would
> simplify the code.  Just .if defined(DESKTOP_ENTRIES) or
> defined(DESKTOP_ENTRIESv2) at the start of parameter processing, and a .if
> defined(DESKTOP_ENTRIESv2) section after it to override the filename.  It
> could also be made polymorphic, basing what it does on the number of fields
> rather than a new DESKTOP_ENTRIESv2 define.

That was my first ideal, but since the entire processing is done in a
@set ${DESKTOP_ENTRIES{,v2}} XXX ; while [$$# -gt {6,7}]; do
filename=$${4,1}... ; done loop, I wasn't sure how to change this
part.

Scot


More information about the freebsd-ports mailing list