Skip to contentSkip to conversation

wic/engine: Fix missing parted autobuilder failures

PATCH New Richard Purdie 1 participant 1 message Feb 15, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wic/engine: Fix missing parted autobuilder failures

OE-Core rev: a88bcbae850a2e6d182291d3f8e167aabdbe4842 broke the ability to find parted as it may be in sbin which is not in PATH for some users on some distros.

Iterate on the original patch to fix this and also fix the original problem.

---
 scripts/lib/wic/engine.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
scripts/lib/wic/engine.py +5 -3
index 880e4640367..ea600d2854e 100644
@@ -244,15 +244,17 @@ class Disk:
         self._psector_size = None
         self._ptable_format = None
 
+        # find parted
         # read paths from $PATH environment variable
         # if it fails, use hardcoded paths
+        pathlist = "/bin:/usr/bin:/usr/sbin:/sbin/"
         try:
-            self.paths = os.environ['PATH']
+            self.paths = os.environ['PATH'] + ":" + pathlist
         except KeyError:
-            self.paths = "/bin:/usr/bin:/usr/sbin:/sbin/"
+            self.paths = pathlist
 
         if native_sysroot:
-            for path in self.paths.split(':'):
+            for path in pathlist.split(':'):
                 self.paths = "%s%s:%s" % (native_sysroot, path, self.paths)
 
         self.parted = find_executable("parted", self.paths)
Signature · 1 line
2.20.1