Re: Speed up bash starting time (slow scripts in profile.d, /etc/bash_completion.d)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Samuel Sieb wrote on Sat, May 16, 2020:
> On 5/16/20 3:56 AM, Dominique Martinet wrote:
>>   - down to 0.130s after moving /etc/bash_completion.d/* to
>> /usr/share/bash-completion/completions/
> 
> I thought that generally, the /etc versions of config directories
> were intended for the purpose of local overrides of the /usr/share
> versions.

Well that is for sure where I would install my own completion scripts
not in rpms, similarily to how just about everything else works with
/etc vs /usr (systemd, udev and friends at least)

>> This one is not actually a no-op: bash-completion loads things from /etc
>> at shell startup time, but things in /usr at first tab time, so if the
>> file in /usr/share is not named by the same prefix as the command it
>> help completes it won't work anymore, but in most case here it will
>> still work just the same (slightly slower on first use)
> 
> That's a strange separation of functionality.  Maybe that's why some
> of them are in there?

The usual "solution" in this case for products that want to maintain a
single script is just to add symlinks to the main one, for example see
lvm: lvchange lvcreate lvdisplay etc etc all symlink to 'lvm' in
/usr/share/bash-completion/completions.

Although in this case very few would need to make one, in the full list
above they almost all complete a single command so just renaming the
file for some would be enough.
In the list I gave, the only two exceptions are lilv which completes two
commands so would need one link, and fzf which overrides the existing
completion for kill so I guess that one has a valid reason to stay in
/etc even if I hadn't noticed until now...

-- 
Dominique
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux