Skip to contentSkip to conversation

base/dracut-lib.sh: remove bashism

PATCH In review Alexander Tsoy 2 participants 2 messages Feb 24, 2015 – Mar 26, 2015 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 base/dracut-lib.sh: remove bashism

---
 modules.d/99base/dracut-lib.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
modules.d/99base/dracut-lib.sh +3 -1
index 079c9a2..fd627dc 100755
@@ -886,7 +886,9 @@ dev_unit_name()
     dev="${dev##/}"
     dev="$(str_replace "$dev" '\' '\x5c')"
     dev="$(str_replace "$dev" '-' '\x2d')"
-    dev=${dev/#\./\\x2e}
+    if [ "${dev##.}" != "$dev" ]; then
+        dev="\x2e${dev##.}"
+    fi
     dev="$(str_replace "$dev" '/' '-')"
 
     printf -- "%s" "$dev"
Signature · 1 line
2.0.5

A message that is not in the archive (sent off-list or not yet received): [email protected]