Blame SOURCES/0532-base-dracut-lib.sh-remove-bashism.patch

5c6c2a
From 9dfcc5f0660b0d7cc7ca251dff940c4f2d0ddf95 Mon Sep 17 00:00:00 2001
5c6c2a
From: Alexander Tsoy <alexander@tsoy.me>
5c6c2a
Date: Tue, 24 Feb 2015 22:28:24 +0300
5c6c2a
Subject: [PATCH] base/dracut-lib.sh: remove bashism
5c6c2a
5c6c2a
Cherry-picked from: 13efce5d
5c6c2a
Resolves: #1306640
5c6c2a
---
5c6c2a
 modules.d/99base/dracut-lib.sh | 4 +++-
5c6c2a
 1 file changed, 3 insertions(+), 1 deletion(-)
5c6c2a
5c6c2a
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
5c6c2a
index 46cee5a9..7502ab66 100755
5c6c2a
--- a/modules.d/99base/dracut-lib.sh
5c6c2a
+++ b/modules.d/99base/dracut-lib.sh
5c6c2a
@@ -888,7 +888,9 @@ dev_unit_name()
5c6c2a
     dev="${dev##/}"
5c6c2a
     dev="$(str_replace "$dev" '\' '\x5c')"
5c6c2a
     dev="$(str_replace "$dev" '-' '\x2d')"
5c6c2a
-    dev=${dev/#\./\\x2e}
5c6c2a
+    if [ "${dev##.}" != "$dev" ]; then
5c6c2a
+        dev="\x2e${dev##.}"
5c6c2a
+    fi
5c6c2a
     dev="$(str_replace "$dev" '/' '-')"
5c6c2a
 
5c6c2a
     printf -- "%s" "$dev"