diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-09-13 14:24:38 +0100 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-09-13 14:25:09 +0100 |
| commit | 3b37a0b17da9b3308447b01661da091722dbf639 (patch) | |
| tree | 2824bc5c0dc0ba105dc21bfa82c622eda34909ac /include | |
| parent | 77b0b448e2ec48c92398f531fa6e31c4b3886270 (diff) | |
lib.sh: simplify update_xbmkver
sanitization can be done with a single sed command
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/lib.sh | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/include/lib.sh b/include/lib.sh index a7e93dfb..427a6aec 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -43,13 +43,8 @@ xbmk_sanitize_version() [ -z "$version" ] && \ return 0 - version="`printf "%s\n" "$version" | sed -e 's/\t//g'`" - version="`printf "%s\n" "$version" | sed -e 's/\ //g'`" - version="`printf "%s\n" "$version" | sed -e 's/\.\.//g'`" - version="`printf "%s\n" "$version" | sed -e 's/\.\///g'`" - version="`printf "%s\n" "$version" | sed -e 's/\//-/g'`" - - version="${version#-}" + version="`printf '%s\n' "$version" | sed \ + 's/[[:space:]]//g; s/\.\.//g; s/\.\///g; s/\//-/g; s/^-//'`" [ -z "$version" ] && \ err "'version' empty after sanitization" \ |
