aboutsummaryrefslogtreecommitdiff
path: root/linaro-hwpack-replace
diff options
context:
space:
mode:
authorDeepti B. Kalakeri <deepti.kalakeri@linaro.org>2011-10-12 17:49:06 +0000
committerDeepti B. Kalakeri <deepti.kalakeri@linaro.org>2011-10-12 17:49:06 +0000
commit9fa41b9f0b5100bc99ceb5071a49d937fa504f67 (patch)
tree392905fb83a514b1f13509f6f42d6885c514eb7b /linaro-hwpack-replace
parent510ae4f1a0f765bd147750ec48130da2591f22f3 (diff)
downloadlinaro-image-tools-9fa41b9f0b5100bc99ceb5071a49d937fa504f67.tar.gz
Changing the timestamp on the hwpack to use utc time than the local time and fixing the tempdir cleanup
Diffstat (limited to 'linaro-hwpack-replace')
-rwxr-xr-xlinaro-hwpack-replace6
1 files changed, 4 insertions, 2 deletions
diff --git a/linaro-hwpack-replace b/linaro-hwpack-replace
index 9f679e1..37c89ff 100755
--- a/linaro-hwpack-replace
+++ b/linaro-hwpack-replace
@@ -78,7 +78,7 @@ def set_logging_param(args):
def get_hwpack_name(old_hwpack):
- timestamp = [datetime.datetime.now().strftime("%Y%m%d-%H%M")]
+ timestamp = [datetime.datetime.utcnow().strftime("%Y%m%d-%H%M")]
hwpack_name_parts = (old_hwpack.split('_', 3))
return('_'.join(hwpack_name_parts[:2] + timestamp + hwpack_name_parts[3:]))
@@ -172,6 +172,7 @@ def main():
new_deb_file_to_copy = args.deb_pack
prefix_pkg_remove = args.prefix_pkg_remove
status = 0
+ tempdir = ""
try:
# Get the new hardware pack name
@@ -227,7 +228,8 @@ def main():
status = 1
finally:
- shutil.rmtree(tempdir)
+ if os.path.exists(tempdir):
+ shutil.rmtree(tempdir)
if status == 0:
logger.info("The debian package '%s' has been been included in '%s'",