New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(dracut.sh): kmoddir does not handle trailing / #2237
Conversation
Fixes dracutdevs#2236 +(/) only works in bash interactive mode. Using any non-interactive bash run simply doesn't remove anything. The solution is copied from dracut-lib.sh, trim().
|
Note: I've checked for similar code and found only: |
|
RHBZ for reference: https://bugzilla.redhat.com/show_bug.cgi?id=2173100# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, thanks for the fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
| @@ -1033,7 +1033,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l)) | |||
| ((stdloglvl < 0)) && stdloglvl=0 | |||
|
|
|||
| [[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l | |||
| drivers_dir="${drivers_dir%%+(/)}" | |||
| drivers_dir="${drivers_dir%"${drivers_dir##*[!/]}"}" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, you could call normalize_path() on the dir. That also replaces multiple / inside the path by a single one, but I don't think that is a problem...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't know that exists. Probably a better solution.
dracutdevs#2237 Resolves: #2173100
Fixes #2236
+(/) only works in bash interactive mode. Using any non-interactive bash run simply doesn't remove anything.
The solution is copied from dracut-lib.sh, trim().
Changes
Trailing / for kmoddir variable are now handled properly.
Checklist
Fixes #2236