On Friday, July 31 2020, Gabriel F. T. Gomes wrote:

> Hi, Sergio,
>
> <3 S2 <3 S2

:-D

> On Thu, 30 Jul 2020, Sergio Durigan Junior wrote:
>> 
>> So, here's the thing.  We can't blindly rely on debhelper's
>> filedoublearray anymore, because of the problem you guys pointed out
>> above.  Which means that bash-completion will probably have to have its
>> own stripped-down, poor-man's version of filedoublearray.  Actually,
>> given the way dh_bash-completion works, it should be enough to have a
>> function that tries to determine whether the file being examined is (a)
>> a bash-completion script, or (b) a file-list.  If (a), then the file
>> itself should be installed.  If (b), then we install each file listed in
>> it.
>
> I really like this approach. It lets filedoublearray be free to do
> whatever it wants, while still working for bash-completion on the file
> list case.

Yep, that's the idea.  Avoid calling filedoublearray if we already know
what we're dealing with.

>> In order to hack this new function I used a little bit of what
>> filedoublearray does in the beginning, and then I crafted a few regexes
>> that will perform a "heuristic" to see if we catch some well-known bash
>> constructions in the file.  If we succeed, then just assume that the
>> file is a bash-completion script and be done with it.  Otherwise, it's
>> (probably) a file-list.
>
> I like the heuristic you came up with; it should be enough to cover all
> completion files I have seen so far and it is so well-documented that
> it should be easy to fix if problems show up.

Cool!  I wasn't sure if you'd like it; it's a bit hacky ;-).  But yeah,
I tried to be careful with the comments because I know that there's a
chance that the function might need to be expanded in order to
accomodate other cases.

>> As far as I have tested, everything works OK.  Of course, this is a
>> heuristic approach and it is possible to craft a problematic file that
>> will cause an error, but it's better than what we have now, IMHO.
>
> +1
>
> I have tested a couple of reverse-build-dependencies of
> bash-completion. Most of them use file lists and the patched debhelper
> script works as before when compat level is updated to 13. I also found
> one package that has a proper completion snippet (pidcat), which also
> works correctly with the patched debhelper script and debhelper 13.
>
> I haven't tested all reverse build dependencies, though. The list is
> too large.

Yeah, the list is large, indeed.  I guess we'll find out whether this
breaks something or not when it reaches unstable and starts to be used
:-).

>> Hopefully this will help.  I'm not tagging this as "+patch" because I'd
>> like to hear your opinions first.
>
> Now tagged.
>
> I'll incorporate this change to the repository, do a little more testing,
> then upload to unstable. May I set git commit authorship to
> "Sergio Durigan Junior <sergi...@debian.org>" ?

Sure thing!  Feel free to mention in the d/changelog entry as well.

Thanks :-).

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
https://sergiodj.net/

Attachment: signature.asc
Description: PGP signature

Reply via email to