From: Richard Purdie Date: Sat, 13 Jun 2026 12:55:04 +0000 (+0100) Subject: scripts/oe-publish-sdk: Convert string subprocess parameters to list X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=f29e2b8a72ecb47b3edd5ed462e33e4d29f0819e;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git scripts/oe-publish-sdk: Convert string subprocess parameters to list Convert string subprocess commands to lists and drop the shell=True. We can drop the sh indirection in one case too. Signed-off-by: Richard Purdie --- diff --git a/scripts/oe-publish-sdk b/scripts/oe-publish-sdk index b8a652e47f5..e24446ce1bf 100755 --- a/scripts/oe-publish-sdk +++ b/scripts/oe-publish-sdk @@ -60,8 +60,8 @@ def publish(args): if not is_remote: mkdir(destination) else: - cmd = "ssh %s 'mkdir -p %s'" % (host, destdir) - ret = subprocess.call(cmd, shell=True) + cmd = ['ssh', host, 'mkdir -p %s' % destdir] + ret = subprocess.call(cmd) if ret != 0: logger.error("Making directory %s on %s failed" % (destdir, host)) return ret @@ -76,8 +76,8 @@ def publish(args): else: shutil.copy(target_sdk, dest_sdk) else: - cmd = "scp %s %s" % (target_sdk, destination) - ret = subprocess.call(cmd, shell=True) + cmd = ['scp', target_sdk, destination] + ret = subprocess.call(cmd) if ret != 0: logger.error("scp %s %s failed" % (target_sdk, destination)) return ret @@ -85,8 +85,8 @@ def publish(args): # Unpack the SDK logger.info("Unpacking SDK") if not is_remote: - cmd = "sh %s -p -y -d %s" % (dest_sdk, destination) - ret = subprocess.call(cmd, shell=True) + cmd = [dest_sdk, '-p', '-y', '-d', destination] + ret = subprocess.call(cmd) if ret == 0: logger.info('Successfully unpacked %s to %s' % (dest_sdk, destination)) os.remove(dest_sdk) @@ -97,8 +97,8 @@ def publish(args): rm_or_not = " && rm -f %s" % dest_sdk if args.keep_orig: rm_or_not = "" - cmd = "ssh %s 'sh %s -p -y -d %s%s'" % (host, dest_sdk, destdir, rm_or_not) - ret = subprocess.call(cmd, shell=True) + cmd = ['ssh', host, 'sh %s -p -y -d %s%s' % (dest_sdk, destdir, rm_or_not)] + ret = subprocess.call(cmd) if ret == 0: logger.info('Successfully unpacked %s to %s' % (dest_sdk, destdir)) else: