mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-09-19 21:20:31 +02:00
lib.sh: simplify update_xbmkver
sanitization can be done with a single sed command Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+2
-7
@@ -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" \
|
||||
|
||||
Reference in New Issue
Block a user