From patchwork Wed Oct 12 08:47:15 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: 4641 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 96F7323EF6 for ; Wed, 12 Oct 2011 08:47:17 +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 8726DA18476 for ; Wed, 12 Oct 2011 08:47:17 +0000 (UTC) Received: by eyg5 with SMTP id 5so661921eyg.11 for ; Wed, 12 Oct 2011 01:47:17 -0700 (PDT) Received: by 10.223.77.71 with SMTP id f7mr23598154fak.33.1318409237361; Wed, 12 Oct 2011 01:47:17 -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 r9cs202823laf; Wed, 12 Oct 2011 01:47:17 -0700 (PDT) Received: by 10.213.2.147 with SMTP id 19mr1851441ebj.6.1318409236079; Wed, 12 Oct 2011 01:47:16 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id s39si994541weq.54.2011.10.12.01.47.15 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Oct 2011 01:47:16 -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 1RDuT5-0005Be-If for ; Wed, 12 Oct 2011 08:47:15 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 85F0BE0030 for ; Wed, 12 Oct 2011 08:47:15 +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: <20111012084715.25874.47505.launchpad@ackee.canonical.com> Date: Wed, 12 Oct 2011 08:47:15 -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: 2caea6b2a0065053632c1ce99203df7da0792956 ------------------------------------------------------------ revno: 446 committer: Deepti B. Kalakeri 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 === 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'",