installerfw-sh-functions: do not omit the last line
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 14 Feb 2014 16:20:03 +0000 (18:20 +0200)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 14 Feb 2014 16:38:57 +0000 (18:38 +0200)
When we are restoring the installer-framework environment in the
'installerfw_restore_env()', we read the '/etc/installerfw-environment' file
line-by line, and export variables.

However, if the last line does not contain the newline character, we ignore it.
So we miss the last variable and do not export it.

This patch fixes the problem, which also fixes TIVI-2652.

Change-Id: I47f560e32a6951b492b0e430a769c4dfc29e5cb5
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
installerfw-sh-functions

index 491e072..bee4a19 100644 (file)
@@ -101,7 +101,7 @@ installerfw_restore_env()
                        "installer framework environment: can't find" \
                        "\"$file\""
 
-       while IFS= read -r line; do
+       while IFS= read -r line || [ -n "$line" ]; do
                eval "export $line"
        done < "$file"