From patchwork Wed Oct 12 18:21:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Deepti B. Kalakeri" X-Patchwork-Id: 4649 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A31C123DEF for ; Wed, 12 Oct 2011 18:21:12 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 848CFA18528 for ; Wed, 12 Oct 2011 18:21:12 +0000 (UTC) Received: by eyg5 with SMTP id 5so1374072eyg.11 for ; Wed, 12 Oct 2011 11:21:12 -0700 (PDT) Received: by 10.223.85.139 with SMTP id o11mr364967fal.0.1318443672275; Wed, 12 Oct 2011 11:21:12 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.24.41 with SMTP id r9cs229700laf; Wed, 12 Oct 2011 11:21:11 -0700 (PDT) Received: by 10.227.5.138 with SMTP id 10mr72572wbv.35.1318443670895; Wed, 12 Oct 2011 11:21:10 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id gd5si782904wbb.100.2011.10.12.11.21.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Oct 2011 11:21:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1RE3QU-0002rZ-CB for ; Wed, 12 Oct 2011 18:21:10 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 51341E24B8 for ; Wed, 12 Oct 2011 18:21:10 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: linaro-image-tools X-Launchpad-Branch: ~linaro-image-tools/linaro-image-tools/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 446 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [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: <20111012182110.7062.69653.launchpad@ackee.canonical.com> Date: Wed, 12 Oct 2011 18:21:10 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14124"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: f042cc8412d4965e1798d8885d2de4983a23c1b0 Merge authors: Deepti B. Kalakeri (deeptik) Related merge proposals: https://code.launchpad.net/~deeptik/linaro-image-tools/fix-hwpack-timestamp/+merge/79161 proposed by: Deepti B. Kalakeri (deeptik) review: Approve - James Westby (james-w) ------------------------------------------------------------ revno: 446 [merge] committer: Deepti B. Kalakeri branch nick: linaro-image-tools timestamp: Wed 2011-10-12 18:16:48 +0000 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 === modified file 'linaro-hwpack-replace' --- linaro-hwpack-replace 2011-10-12 07:34:51 +0000 +++ linaro-hwpack-replace 2011-10-12 17:49:06 +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'",