Mostly whitespace fixes but also some r"" strings to clarify regular expressions.
Signed-off-by: Ross Burton <[email protected]> --- scripts/runqemu | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/scripts/runqemu b/scripts/runqemu index c4a0ca811d9..9beb7b00fc0 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -127,7 +127,7 @@ def check_libgl(qemu_bin): ('/usr/lib/*-linux-gnu/libGL.so', '/usr/lib/*-linux-gnu/libGLU.so')) for (f1, f2) in check_files: - if re.search('\*', f1): + if re.search(r'\*', f1): for g1 in glob.glob(f1): if libgl: break @@ -179,12 +179,12 @@ class BaseConfig(object): # Supported env vars, add it here if a var can be got from env, # and don't use os.getenv in the code. self.env_vars = ('MACHINE', - 'ROOTFS', - 'KERNEL', - 'DEVICE_TREE', - 'DEPLOY_DIR_IMAGE', - 'OE_TMPDIR', - 'OECORE_NATIVE_SYSROOT', + 'ROOTFS', + 'KERNEL', + 'DEVICE_TREE', + 'DEPLOY_DIR_IMAGE', + 'OE_TMPDIR', + 'OECORE_NATIVE_SYSROOT', ) self.qemu_opt = '' @@ -329,10 +329,10 @@ class BaseConfig(object): if p.endswith('.qemuboot.conf'): self.qemuboot = p self.qbconfload = True - elif re.search('\.bin$', p) or re.search('bzImage', p) or \ + elif re.search(r'\.bin$', p) or re.search('bzImage', p) or \ re.search('zImage', p) or re.search('vmlinux', p) or \ re.search('fitImage', p) or re.search('uImage', p): - self.kernel = p + self.kernel = p elif os.path.exists(p) and (not os.path.isdir(p)) and '-image-' in os.path.basename(p): self.rootfs = p # Check filename against self.fstypes can hanlde <file>.cpio.gz, @@ -343,13 +343,13 @@ class BaseConfig(object): fst = t break if not fst: - m = re.search('.*\.(.*)$', self.rootfs) + m = re.search(r'.*\.(.*)$', self.rootfs) if m: - fst = m.group(1) + fst = m.group(1) if fst: self.check_arg_fstype(fst) - qb = re.sub('\.' + fst + "$", '', self.rootfs) - qb = '%s%s' % (re.sub('\.rootfs$', '', qb), '.qemuboot.conf') + qb = re.sub(r'\.' + fst + "$", '', self.rootfs) + qb = '%s%s' % (re.sub(r'\.rootfs$', '', qb), '.qemuboot.conf') if os.path.exists(qb): self.qemuboot = qb self.qbconfload = True @@ -538,9 +538,9 @@ class BaseConfig(object): raise RunQemuError(yocto_paravirt_kvm_wiki) if not os.access(dev_kvm, os.W_OK|os.R_OK): - logger.error("You have no read or write permission on /dev/vhost-net.") - logger.error("Please change the ownership of this file as described at:") - raise RunQemuError(yocto_kvm_wiki) + logger.error("You have no read or write permission on /dev/vhost-net.") + logger.error("Please change the ownership of this file as described at:") + raise RunQemuError(yocto_kvm_wiki) def check_fstype(self): """Check and setup FSTYPE""" @@ -569,8 +569,8 @@ class BaseConfig(object): if self.rootfs and not os.path.exists(self.rootfs): # Lazy rootfs self.rootfs = "%s/%s-%s.%s" % (self.get('DEPLOY_DIR_IMAGE'), - self.rootfs, self.get('MACHINE'), - self.fstype) + self.rootfs, self.get('MACHINE'), + self.fstype) elif not self.rootfs: cmd_name = '%s/%s*.%s' % (self.get('DEPLOY_DIR_IMAGE'), self.get('IMAGE_NAME'), self.fstype) cmd_link = '%s/%s*.%s' % (self.get('DEPLOY_DIR_IMAGE'), self.get('IMAGE_LINK_NAME'), self.fstype) @@ -826,7 +826,7 @@ class BaseConfig(object): print('DTB: [%s]' % self.dtb) print('MACHINE: [%s]' % self.get('MACHINE')) print('FSTYPE: [%s]' % self.fstype) - if self.fstype == 'nfs': + if self.fstype == 'nfs': print('NFS_DIR: [%s]' % self.rootfs) else: print('ROOTFS: [%s]' % self.rootfs) @@ -844,7 +844,7 @@ class BaseConfig(object): # Figure out a new nfs_instance to allow multiple qemus running. ps = subprocess.check_output(("ps", "auxww")).decode('utf-8') - pattern = '/bin/unfsd .* -i .*\.pid -e .*/exports([0-9]+) ' + pattern = r'/bin/unfsd .* -i .*\.pid -e .*/exports([0-9]+) ' all_instances = re.findall(pattern, ps, re.M) if all_instances: all_instances.sort(key=int) @@ -863,7 +863,7 @@ class BaseConfig(object): # Use '%s' since they are integers os.putenv(k, '%s' % v) - self.unfs_opts="nfsvers=3,port=%s,udp,mountport=%s" % (nfsd_port, mountd_port) + self.unfs_opts = "nfsvers=3,port=%s,udp,mountport=%s" % (nfsd_port, mountd_port) # Extract .tar.bz2 or .tar.bz if no nfs dir if not (self.rootfs and os.path.isdir(self.rootfs)): @@ -1160,8 +1160,8 @@ class BaseConfig(object): self.qemu_opt = "%s %s %s %s" % (qemu_bin, self.get('NETWORK_CMD'), self.get('ROOTFS_OPTIONS'), self.get('QB_OPT_APPEND')) for ovmf in self.ovmf_bios: - format = ovmf.rsplit('.', 1)[-1] - self.qemu_opt += ' -drive if=pflash,format=%s,file=%s' % (format, ovmf) + fmt = ovmf.rsplit('.', 1)[-1] + self.qemu_opt += ' -drive if=pflash,format=%s,file=%s' % (fmt, ovmf) if self.ovmf_bios: # OVMF only supports normal VGA, i.e. we need to override a -vga vmware # that gets added for example for normal qemux86. -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core
