Bug 1220458

Summary: After bash-completion 2.12.0 introduction software depending on are broken _split_longopt missing
Product: [openSUSE] openSUSE Tumbleweed Reporter: Bruno Friedmann <bruno>
Component: UsabilityAssignee: Simon Lees <simonf.lees>
Status: NEW --- QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: dmueller, werner
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Bruno Friedmann 2024-02-27 14:05:30 UTC
On tumbleweed 20240225 with bash-completion 2.12.0 installed
a lot of software using bash completion are failing like

cmake  _split_longopt: command not found ...

so the function used in bash-completion to warn about deprecated name is not working or masked by command not found.
Comment 1 Dr. Werner Fink 2024-03-07 11:39:14 UTC
(In reply to Bruno Friedmann from comment #0)
> On tumbleweed 20240225 with bash-completion 2.12.0 installed
> a lot of software using bash completion are failing like
> 
> cmake  _split_longopt: command not found ...
> 
> so the function used in bash-completion to warn about deprecated name is not
> working or masked by command not found.

Then cmake bash complewtion has to be ported to latest bash-completion 2.12.0
Comment 2 Bruno Friedmann 2024-03-07 13:49:25 UTC
Hi, what I apply as temporary fix was to remove the command-not-found we have in openSUSE.

That make at least cmake to no more get bogus return, and use the deprecated method proposed in bash-completion 2.12.

So we can close here, or at least point the problem to our own cnf implementation.
Comment 3 Dr. Werner Fink 2024-03-07 14:21:56 UTC
(In reply to Bruno Friedmann from comment #2)
> Hi, what I apply as temporary fix was to remove the command-not-found we
> have in openSUSE.
> 
> That make at least cmake to no more get bogus return, and use the deprecated
> method proposed in bash-completion 2.12.
> 
> So we can close here, or at least point the problem to our own cnf
> implementation.

That is only a workaround ... I'd like to see a fixed bash completion of cmake that is use _comp__split_longopt() instead of _split_longopt()

from

diff -up bash-completion-2.11/ bash-completion-2.12.0/bash_completion
[...]
@@ -626,13 +1159,13 @@ _filedir()
 # this to be useful.
 # Returns 0 if current option was split, 1 otherwise.
 #
-_split_longopt()
+_comp__split_longopt()
 {
     if [[ $cur == --?*=* ]]; then
         # Cut also backslash before '=' in case it ended up there
         # for some reason.
-        prev="${cur%%?(\\)=*}"
-        cur="${cur#*=}"
+        prev=${cur%%?(\\)=*}
+        cur=${cur#*=}
         return 0
     fi