]> code.ossystems Code Review - openembedded-core.git/commitdiff
oe-publish-sdk: add --keep-orig option
authorAdrian Freihofer <adrian.freihofer@gmail.com>
Mon, 7 Sep 2020 16:43:14 +0000 (18:43 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 8 Sep 2020 15:43:35 +0000 (16:43 +0100)
Support publishing the sdk-update as well as the sdk installer in one
go.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/oe-publish-sdk

index 19a5d69864ce6d9c35ac2ff05702dd0cbb5fb78a..deb8ae18078ff4094938bd4a7dae7ad705e1e444 100755 (executable)
@@ -94,7 +94,10 @@ def publish(args):
             logger.error('Failed to unpack %s to %s' % (dest_sdk, destination))
             return ret
     else:
-        cmd = "ssh %s 'sh %s -p -y -d %s && rm -f %s'" % (host, dest_sdk, destdir, dest_sdk)
+        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)
         if ret == 0:
             logger.info('Successfully unpacked %s to %s' % (dest_sdk, destdir))
@@ -119,6 +122,7 @@ def main():
     parser = argparse_oe.ArgumentParser(description="OpenEmbedded extensible SDK publishing tool - writes server-side data to support the extensible SDK update process to a specified location")
     parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true')
     parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true')
+    parser.add_argument('-k', '--keep-orig', help='When published to a remote host, the eSDK installer gets deleted by default.', action='store_true')
 
     parser.add_argument('sdk', help='Extensible SDK to publish (path to .sh installer file)')
     parser.add_argument('dest', help='Destination to publish SDK to; can be local path or remote in the form of user@host:/path (in the latter case ssh/scp will be used).')