[pacman-dev] [PATCH] Provides generation for files (a.k.a. rpm fileattrs for makepkg)
Eli Schwartz
eschwartz at archlinux.org
Mon Mar 9 10:54:21 UTC 2020
On 3/8/20 6:49 PM, Eli Schwartz wrote:
> On 3/8/20 6:39 PM, Carson Black wrote:
>>> What is "cleaned", and how is the xargs program "cleaning" it?
>>
>> Excess whitespace is being trimmed using xargs. " a string
>> " will get normalized to "a string" when passed through xargs.
>
> Examples of desktop files with this issue? I didn't find one like it on
> my system.
>
>>>
>>>> +
>>>> + [[ -z "$cleaned" ]] && continue
>>>
>>> When will this be set but empty?
>>
>> Trailing semicolon in desktop file will result in a blank entry in the
>> mimetypes array,
>> resulting in a blank can-open-mimetype() provide without this code.
>
> $ mapfile -t -d ";" mimetypes < <(grep MimeType=
> /usr/share/applications/qemu.desktop | cut -d '=' -f 2)
> $ declare -p mimetypes
> declare -a mimetypes=()
Not sure what I was thinking here, lol, it is in fact a problem when the
Mimetypes= line *does* exist. A good way to solve this would be
[[ -n ${mimetypes[-1]//$'\n'} ]] || unset mimetypes[-1]
--
Eli Schwartz
Bug Wrangler and Trusted User
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1601 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/pacman-dev/attachments/20200309/bdc7b897/attachment.sig>
More information about the pacman-dev
mailing list