diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 446: Changing the timestamp on the hwpack to use utc time than the local time and fixing the tempdir c...

Message ID 20111012084715.25874.47505.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Deepti B. Kalakeri Oct. 12, 2011, 8:47 a.m. UTC
------------------------------------------------------------
revno: 446
committer: Deepti B. Kalakeri<deepti.kalakeri@linaro.org>
branch nick: linaro-image-tools
timestamp: Wed 2011-10-12 14:14:24 +0530
message:
  Changing the timestamp on the hwpack to use utc time than the local time and fixing the tempdir cleanup
modified:
  linaro-hwpack-replace


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'linaro-hwpack-replace'
--- linaro-hwpack-replace	2011-10-12 07:34:51 +0000
+++ linaro-hwpack-replace	2011-10-12 08:44:24 +0000
@@ -78,7 +78,7 @@ 
 
 
 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 @@ 
     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 @@ 
         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'",