]> git.pld-linux.org Git - packages/efi-boot-update.git/commitdiff
Disable backslash escaping in echo
authorJacek Konieczny <jajcus@jajcus.net>
Thu, 24 Oct 2013 15:52:53 +0000 (17:52 +0200)
committerJacek Konieczny <jajcus@jajcus.net>
Thu, 24 Oct 2013 15:52:53 +0000 (17:52 +0200)
In shells where echo backslash escaping is enabled by default
the EFI paths (backslash-delimited) get badly scrambled.

efi-boot-update

index ec420f73134d7d9e53af2c44dcf51a335fa3d9e3..b031d67fece6af96a607b776276116f6ed66d9a7 100755 (executable)
@@ -19,18 +19,18 @@ usage () {
 }
 
 msg () {
 }
 
 msg () {
-    echo "efi-boot-update: $*" >&2
+    echo -E "efi-boot-update: $*" >&2
 }
 
 verbose () {
     if is_yes "$VERBOSE" ; then 
 }
 
 verbose () {
     if is_yes "$VERBOSE" ; then 
-        echo "efi-boot-update: $*" >&2
+        echo -E "efi-boot-update: $*" >&2
     fi
 }
 
 verbose_cmd () {
     if is_yes "$VERBOSE" ; then
     fi
 }
 
 verbose_cmd () {
     if is_yes "$VERBOSE" ; then
-        echo "+$*" >&2
+        echo -E "+$*" >&2
     fi
     "$@"
 }
     fi
     "$@"
 }
@@ -42,7 +42,7 @@ list_remove () {
         if [ "$item" = "$2" ] ; then
             continue
         fi
         if [ "$item" = "$2" ] ; then
             continue
         fi
-        echo -n "$item "
+        echo -nE "$item "
     done
 }
 
     done
 }
 
@@ -140,7 +140,7 @@ add_bootmgr_entry () {
         binary="$DESTDIR/$binary"
     fi
     binary="${binary#/boot/efi}"
         binary="$DESTDIR/$binary"
     fi
     binary="${binary#/boot/efi}"
-    binary="$(echo -n "$binary"|sed -e's;/;\\;g')"
+    binary="$(echo -nE "$binary"|sed -e's;/;\\;g')"
 
     if [ -n "$bootnum" ] ; then
         echo -n "$args" | verbose_cmd $EFIBOOTMGR $EFIBOOTMGR_OPTS --quiet \
 
     if [ -n "$bootnum" ] ; then
         echo -n "$args" | verbose_cmd $EFIBOOTMGR $EFIBOOTMGR_OPTS --quiet \
This page took 0.072722 seconds and 4 git commands to generate.