Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 907061 - app-shells/bash: new globskipdots shopt in 5.2 raises minor backward-compatibility concerns
Summary: app-shells/bash: new globskipdots shopt in 5.2 raises minor backward-compatib...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: https://pubs.opengroup.org/onlinepubs...
Whiteboard:
Keywords: PullRequest
Depends on: 933499
Blocks: bash-5.2
  Show dependency tree
 
Reported: 2023-05-24 07:35 UTC by RumpletonBongworth
Modified: 2024-06-20 17:58 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 RumpletonBongworth 2023-05-24 07:35:04 UTC
The release notes for 5.2 state the following:-

"The new `globskipdots' shell option forces pathname expansion never to return `.' or `..' unless explicitly matched. It is enabled by default."

This is a backwards-incompatible change, because the option in question defaults to being enabled. Further, it violates the standard rules for matching against pathnames containing a leading period.

$ declare -p BASH_VERSION
declare -- BASH_VERSION="5.1.16(1)-release"
$ cd /var/empty; printf %s\\n .?
..

$ declare -p BASH_VERSION
declare -- BASH_VERSION="5.2.15(1)-release"
$ cd /var/empty; printf %s\\n .?
.?

Is it covered by BASH_COMPAT? Of course not!

$ BASH_COMPAT=50
$ printf %s\\n .?
.?

That being said, I consider it to be exceedingly unlikely that this change meaningfully impacts upon portage or any of the ebuilds and eclasses that exist, both of the official and unofficial variety. Nevertheless, I decided to report this because, from the standpoint of PMS purporting to retain backward-compatibility, portage's present behaviour is not strictly correct.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-25 03:39:04 UTC
I'll tentatively block bug 881379 just as it's something we should review before proceeding with stabilisation, even if we don't keep it as a blocker.
Comment 3 Larry the Git Cow gentoo-dev 2024-06-13 02:34:50 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=19e750b6880c1ffba55c4d309fbf33d5e746ee33

commit 19e750b6880c1ffba55c4d309fbf33d5e746ee33
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-06-13 02:20:27 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-06-13 02:23:38 +0000

    bin/ebuild.sh: disable globskipdots too in Bash 5.2
    
    See 69cac73ba0a7bcf2e2cff88c60d389895a550623.
    
    globskipdots is a new option in bash-5.2 that is also default-on
    in that release. The default value is not gated by BASH_COMPAT (see bug #907061),
    hence we need to disable it for older Bashes to avoid behaviour changes in ebuilds
    and eclasses.
    
    Bug: https://bugs.gentoo.org/907061
    Signed-off-by: Sam James <sam@gentoo.org>

 NEWS          | 6 ++++++
 bin/ebuild.sh | 8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-20 17:58:26 UTC
We've done what we can -- the Portage change isn't yet released but I'll try to do that soon.