Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 837203 - app-shells/bash-5.2_alpha: breaks app-shells/gentoo-bashcomp
Summary: app-shells/bash-5.2_alpha: breaks app-shells/gentoo-bashcomp
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-08 02:37 UTC by labyrithfind
Modified: 2022-07-26 06:14 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description labyrithfind 2022-04-08 02:37:19 UTC
Note:
- If using app-shell/bash-5.2_alpha , the emerge command bash completion, would not able to work.
- if using app-shells/bash-5.1_p16, everything is fine.

The error message would be:

# . /usr/share/bash-completion/completions/emerge
bash: /usr/share/bash-completion/completions/emerge: line 146: syntax error near unexpected token `${COMPREPLY/ ${i%% *} / }'
bash: /usr/share/bash-completion/completions/emerge: line 146: `                COMPREPLY=(${COMPREPLY/ ${i%% *} / })'
bash: /usr/share/bash-completion/completions/emerge: line 147: syntax error near unexpected token `done'
bash: /usr/share/bash-completion/completions/emerge: line 147: `            done'

Since this bash completion script, is in app-shells/gentoo-bashcomp package, some modify might get needed, so it would also work in 5.2 version of bash.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-08 04:00:40 UTC
I'm fairly sure this is fixed upstream since but we need to wait until the next testing version is out (beta is next).

I did ask for a new alpha but was told to wait for the beta.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-14 07:48:52 UTC
Beta is now in tree, works fine for me now.
Comment 3 labyrithfind 2022-04-22 12:47:28 UTC
Hi @Sam, it looks the bug is still there on my end, today i upgrade bash to 5.2_beta, and the issue is still there.

Output is:

# bash -version
GNU bash, version 5.2.0(1)-beta (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

# . /usr/share/bash-completion/completions/emerge
bash: /usr/share/bash-completion/completions/emerge: line 146: syntax error near unexpected token `${COMPREPLY/ ${i%% *} / }'
bash: /usr/share/bash-completion/completions/emerge: line 146: `                COMPREPLY=(${COMPREPLY/ ${i%% *} / })'
bash: /usr/share/bash-completion/completions/emerge: line 147: syntax error near unexpected token `done'
bash: /usr/share/bash-completion/completions/emerge: line 147: `            done'

Seems like exact the previous error message in alpha version right?
Comment 4 labyrithfind 2022-04-22 12:48:34 UTC
(In reply to Sam James from comment #2)
> Beta is now in tree, works fine for me now.

Refer the previous update
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-22 20:43:30 UTC
hi! Ah, I'd assumed it was the same issue I'd hit.

Could you try bash-9999 (in a safe environment with backups, obviously, not a production system) and then if that fails, let me know, and also report it upstream using 'bashbug'?
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-28 16:28:05 UTC
(In reply to Sam James from comment #5)
> hi! Ah, I'd assumed it was the same issue I'd hit.
> 
> Could you try bash-9999 (in a safe environment with backups, obviously, not
> a production system) and then if that fails, let me know, and also report it
> upstream using 'bashbug'?

Thanks for reporting it. In the latest bash git commit (https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=d0cd67ee13930ade6d926e3387551b79e8c5be37):
```
+	- parse_comsub: non-interactive shells exit on a syntax error while
+	  parsing the command substitution
+	- parse_comsub: unset additional PARSER_STATE flags before calling
+	  yyparse(). Inspired by https://bugs.gentoo.org/837203; unsetting
+	  PST_COMPASSIGN is the fix for that bug
```

\o/