[oe-commits] [openembedded-core] 13/13: wic/engine.py: Load paths from PATH environment variable

git at git.openembedded.org git at git.openembedded.org
Thu Feb 14 11:22:35 UTC 2019

This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit a88bcbae850a2e6d182291d3f8e167aabdbe4842
Author: William Bourque <wbourque at gmail.com>
AuthorDate: Mon Feb 11 15:00:48 2019 -0500

    wic/engine.py: Load paths from PATH environment variable
    Load self.paths from environment variable and
    if it fails, fall back to hardcoded list.
    This is required for users that would need to load
    different e2fsprogs binaries if their system's ones
    are not recent enought
    Signed-off-by: William Bourque <wbourque at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
 scripts/lib/wic/engine.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
index 97f5e84..880e464 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -244,8 +244,13 @@ class Disk:
         self._psector_size = None
         self._ptable_format = None
-        # find parted
-        self.paths = "/bin:/usr/bin:/usr/sbin:/sbin/"
+        # read paths from $PATH environment variable
+        # if it fails, use hardcoded paths
+        try:
+            self.paths = os.environ['PATH']
+        except KeyError:
+            self.paths = "/bin:/usr/bin:/usr/sbin:/sbin/"
         if native_sysroot:
             for path in self.paths.split(':'):
                 self.paths = "%s%s:%s" % (native_sysroot, path, self.paths)

To stop receiving notification emails like this one, please contact
the administrator of this repository.

More information about the Openembedded-commits mailing list