diff options
-rwxr-xr-x | scripts/oe-publish-sdk | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/oe-publish-sdk b/scripts/oe-publish-sdk index 9e4f1bfc65..e91888f8d8 100755 --- a/scripts/oe-publish-sdk +++ b/scripts/oe-publish-sdk | |||
@@ -53,6 +53,7 @@ def publish(args): | |||
53 | else: | 53 | else: |
54 | is_remote = False | 54 | is_remote = False |
55 | dest_sdk = os.path.join(destination, sdk_basename) | 55 | dest_sdk = os.path.join(destination, sdk_basename) |
56 | destdir = destination | ||
56 | 57 | ||
57 | # Making sure the directory exists | 58 | # Making sure the directory exists |
58 | logger.debug("Making sure the destination directory exists") | 59 | logger.debug("Making sure the destination directory exists") |
@@ -83,16 +84,19 @@ def publish(args): | |||
83 | 84 | ||
84 | # Unpack the SDK | 85 | # Unpack the SDK |
85 | logger.info("Unpacking SDK") | 86 | logger.info("Unpacking SDK") |
87 | cleanupfiles = [dest_sdk, os.path.join(destdir, 'ext-sdk-prepare.py')] | ||
86 | if not is_remote: | 88 | if not is_remote: |
87 | cmd = "sh %s -n -y -d %s" % (dest_sdk, destination) | 89 | cmd = "sh %s -n -y -d %s" % (dest_sdk, destination) |
88 | ret = subprocess.call(cmd, shell=True) | 90 | ret = subprocess.call(cmd, shell=True) |
89 | if ret == 0: | 91 | if ret == 0: |
90 | logger.info('Successfully unpacked %s to %s' % (dest_sdk, destination)) | 92 | logger.info('Successfully unpacked %s to %s' % (dest_sdk, destination)) |
93 | for cleanupfile in cleanupfiles: | ||
94 | os.remove(cleanupfile) | ||
91 | else: | 95 | else: |
92 | logger.error('Failed to unpack %s to %s' % (dest_sdk, destination)) | 96 | logger.error('Failed to unpack %s to %s' % (dest_sdk, destination)) |
93 | return ret | 97 | return ret |
94 | else: | 98 | else: |
95 | cmd = "ssh %s 'sh %s -n -y -d %s'" % (host, dest_sdk, destdir) | 99 | cmd = "ssh %s 'sh %s -n -y -d %s && rm -f %s'" % (host, dest_sdk, destdir, ' '.join(cleanupfiles)) |
96 | ret = subprocess.call(cmd, shell=True) | 100 | ret = subprocess.call(cmd, shell=True) |
97 | if ret == 0: | 101 | if ret == 0: |
98 | logger.info('Successfully unpacked %s to %s' % (dest_sdk, destdir)) | 102 | logger.info('Successfully unpacked %s to %s' % (dest_sdk, destdir)) |