]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
scripts/oe-publish-sdk: Convert string subprocess parameters to list
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 13 Jun 2026 12:55:04 +0000 (13:55 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 6 Jul 2026 10:02:19 +0000 (11:02 +0100)
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 <richard.purdie@linuxfoundation.org>
scripts/oe-publish-sdk

index b8a652e47f547e5585ac9d34a227866c7daebaf5..e24446ce1bfb20be2722ce193b2833028d89c744 100755 (executable)
@@ -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: