diff options
| -rw-r--r-- | scripts/lib/wic/engine.py | 6 | ||||
| -rw-r--r-- | scripts/lib/wic/misc.py | 4 | ||||
| -rwxr-xr-x | scripts/wic | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py index 018815b966..674ccfc244 100644 --- a/scripts/lib/wic/engine.py +++ b/scripts/lib/wic/engine.py | |||
| @@ -19,10 +19,10 @@ import os | |||
| 19 | import tempfile | 19 | import tempfile |
| 20 | import json | 20 | import json |
| 21 | import subprocess | 21 | import subprocess |
| 22 | import shutil | ||
| 22 | import re | 23 | import re |
| 23 | 24 | ||
| 24 | from collections import namedtuple, OrderedDict | 25 | from collections import namedtuple, OrderedDict |
| 25 | from distutils.spawn import find_executable | ||
| 26 | 26 | ||
| 27 | from wic import WicError | 27 | from wic import WicError |
| 28 | from wic.filemap import sparse_copy | 28 | from wic.filemap import sparse_copy |
| @@ -245,7 +245,7 @@ class Disk: | |||
| 245 | for path in pathlist.split(':'): | 245 | for path in pathlist.split(':'): |
| 246 | self.paths = "%s%s:%s" % (native_sysroot, path, self.paths) | 246 | self.paths = "%s%s:%s" % (native_sysroot, path, self.paths) |
| 247 | 247 | ||
| 248 | self.parted = find_executable("parted", self.paths) | 248 | self.parted = shutil.which("parted", path=self.paths) |
| 249 | if not self.parted: | 249 | if not self.parted: |
| 250 | raise WicError("Can't find executable parted") | 250 | raise WicError("Can't find executable parted") |
| 251 | 251 | ||
| @@ -283,7 +283,7 @@ class Disk: | |||
| 283 | "resize2fs", "mkswap", "mkdosfs", "debugfs","blkid"): | 283 | "resize2fs", "mkswap", "mkdosfs", "debugfs","blkid"): |
| 284 | aname = "_%s" % name | 284 | aname = "_%s" % name |
| 285 | if aname not in self.__dict__: | 285 | if aname not in self.__dict__: |
| 286 | setattr(self, aname, find_executable(name, self.paths)) | 286 | setattr(self, aname, shutil.which(name, path=self.paths)) |
| 287 | if aname not in self.__dict__ or self.__dict__[aname] is None: | 287 | if aname not in self.__dict__ or self.__dict__[aname] is None: |
| 288 | raise WicError("Can't find executable '{}'".format(name)) | 288 | raise WicError("Can't find executable '{}'".format(name)) |
| 289 | return self.__dict__[aname] | 289 | return self.__dict__[aname] |
diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py index 57c042c503..3e11822996 100644 --- a/scripts/lib/wic/misc.py +++ b/scripts/lib/wic/misc.py | |||
| @@ -16,9 +16,9 @@ import logging | |||
| 16 | import os | 16 | import os |
| 17 | import re | 17 | import re |
| 18 | import subprocess | 18 | import subprocess |
| 19 | import shutil | ||
| 19 | 20 | ||
| 20 | from collections import defaultdict | 21 | from collections import defaultdict |
| 21 | from distutils import spawn | ||
| 22 | 22 | ||
| 23 | from wic import WicError | 23 | from wic import WicError |
| 24 | 24 | ||
| @@ -122,7 +122,7 @@ def find_executable(cmd, paths): | |||
| 122 | if provided and "%s-native" % recipe in provided: | 122 | if provided and "%s-native" % recipe in provided: |
| 123 | return True | 123 | return True |
| 124 | 124 | ||
| 125 | return spawn.find_executable(cmd, paths) | 125 | return shutil.which(cmd, path=paths) |
| 126 | 126 | ||
| 127 | def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""): | 127 | def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""): |
| 128 | """ | 128 | """ |
diff --git a/scripts/wic b/scripts/wic index 57197c2048..4bcff8f79c 100755 --- a/scripts/wic +++ b/scripts/wic | |||
| @@ -22,9 +22,9 @@ import sys | |||
| 22 | import argparse | 22 | import argparse |
| 23 | import logging | 23 | import logging |
| 24 | import subprocess | 24 | import subprocess |
| 25 | import shutil | ||
| 25 | 26 | ||
| 26 | from collections import namedtuple | 27 | from collections import namedtuple |
| 27 | from distutils import spawn | ||
| 28 | 28 | ||
| 29 | # External modules | 29 | # External modules |
| 30 | scripts_path = os.path.dirname(os.path.realpath(__file__)) | 30 | scripts_path = os.path.dirname(os.path.realpath(__file__)) |
| @@ -47,7 +47,7 @@ if os.environ.get('SDKTARGETSYSROOT'): | |||
| 47 | break | 47 | break |
| 48 | sdkroot = os.path.dirname(sdkroot) | 48 | sdkroot = os.path.dirname(sdkroot) |
| 49 | 49 | ||
| 50 | bitbake_exe = spawn.find_executable('bitbake') | 50 | bitbake_exe = shutil.which('bitbake') |
| 51 | if bitbake_exe: | 51 | if bitbake_exe: |
| 52 | bitbake_path = scriptpath.add_bitbake_lib_path() | 52 | bitbake_path = scriptpath.add_bitbake_lib_path() |
| 53 | import bb | 53 | import bb |
