initrd.scripts: fs_type_in_use() simplification#26
Open
Karlson2k wants to merge 1 commit intogentoo:masterfrom
Open
initrd.scripts: fs_type_in_use() simplification#26Karlson2k wants to merge 1 commit intogentoo:masterfrom
Karlson2k wants to merge 1 commit intogentoo:masterfrom
Conversation
Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru>
17d6cc4 to
7b8be8e
Compare
robbat2
requested changes
May 16, 2022
| fs_type_in_use() { | ||
| fs_type=$1 | ||
| cut -d ' ' -f 3 < /proc/mounts | grep -Fq "${fs_type}" | ||
| grep -Eqse "^[^ ]+ [^ ]+ ${1} " /proc/mounts |
There was a problem hiding this comment.
please see my comments on PR#27 and switch to using awk instead.
Much cleaner to understand.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One more simplification and speed-up.
When processing the file directly grep could exit at the first match, without processing the whole stream.