]> git.pld-linux.org Git - packages/efi-boot-update.git/blobdiff - efi-boot-update
Some variable quotting added
[packages/efi-boot-update.git] / efi-boot-update
index 0684182c8b82f9a464b52a651c2590809dc30c0a..88e1d86d139d2412079bbd85d8e8dbe00fca7698 100755 (executable)
@@ -19,18 +19,18 @@ usage () {
 }
 
 msg () {
-    echo "efi-boot-update: $*" >&2
+    echo -E "efi-boot-update: $*" >&2
 }
 
 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
-        echo "+$*" >&2
+        echo -E "+$*" >&2
     fi
     "$@"
 }
@@ -42,7 +42,7 @@ list_remove () {
         if [ "$item" = "$2" ] ; then
             continue
         fi
-        echo -n "$item "
+        echo -nE "$item "
     done
 }
 
@@ -66,11 +66,18 @@ update_file () {
         esac
     done
     src="$1"; shift
-    dst="$2"; shift
+    dst="$1"; shift
     if [ -n "$*" ] ; then
         msg "update_file: unexpected arguments: $*"
         return 1
     fi
+    if [ -z "$src" ] ; then
+        msg "update_file: no source file"
+        return 1
+    fi
+    if [ -z "$dst" ] ; then
+        dst=`basename "$src"`
+    fi
     if [ "${dst#/}" = "${dst}" ] ; then
         # relative path
         dst="$DESTDIR/$dst"
@@ -122,9 +129,9 @@ remove_bootmgr_entry () {
 }
 
 add_bootmgr_entry () {
-    local label=$1
-    local binary=$2
-    local args=$3
+    local label="$1"
+    local binary="$2"
+    local args="$3"
     local bootnum
     bootnum=$(find_bootmgr_entry "$label")
 
@@ -133,7 +140,7 @@ add_bootmgr_entry () {
         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 \
This page took 0.639131 seconds and 4 git commands to generate.