From patchwork Thu Jul 28 14:55:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: loic.minier@linaro.org X-Patchwork-Id: 3188 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 6A75023F52 for ; Thu, 28 Jul 2011 14:55:46 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id 175A1A184EA for ; Thu, 28 Jul 2011 14:55:46 +0000 (UTC) Received: by qyk30 with SMTP id 30so1958960qyk.11 for ; Thu, 28 Jul 2011 07:55:45 -0700 (PDT) Received: by 10.229.25.212 with SMTP id a20mr19689qcc.148.1311864945416; Thu, 28 Jul 2011 07:55:45 -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.229.217.78 with SMTP id hl14cs180982qcb; Thu, 28 Jul 2011 07:55:45 -0700 (PDT) Received: by 10.14.8.65 with SMTP id 41mr47103eeq.197.1311864944293; Thu, 28 Jul 2011 07:55:44 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id u49si2056737weq.103.2011.07.28.07.55.43; Thu, 28 Jul 2011 07:55:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QmRzz-0006q5-MW for ; Thu, 28 Jul 2011 14:55:43 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id A723C2E800E for ; Thu, 28 Jul 2011 14:55:43 +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: 396 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 396: Merge lp:~lool/linaro-image-tools/misc-syntax-fixes; fixes support for older Message-Id: <20110728145543.15867.93716.launchpad@loganberry.canonical.com> Date: Thu, 28 Jul 2011 14:55:43 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13535"; Instance="initZopeless config overlay" X-Launchpad-Hash: d9d478072b6046699db061aaf30ce2d58b5ce3c9 Merge authors: Loïc Minier (lool) Related merge proposals: https://code.launchpad.net/~lool/linaro-image-tools/misc-syntax-fixes/+merge/69621 proposed by: Loïc Minier (lool) ------------------------------------------------------------ revno: 396 [merge] fixes bug(s): https://launchpad.net/bugs/817060 committer: Loïc Minier branch nick: linaro-image-tools timestamp: Thu 2011-07-28 16:53:44 +0200 message: Merge lp:~lool/linaro-image-tools/misc-syntax-fixes; fixes support for older Python versions and various syntax issues reported by pyflakes; LP: #817060. modified: README linaro_image_tools/fetch_image.py linaro_image_tools/hwpack/builder.py linaro_image_tools/media_create/tests/test_media_create.py linaro_image_tools/tests/test_pyflakes.py --- 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 'README' --- README 2011-04-29 11:04:38 +0000 +++ README 2011-07-28 10:48:11 +0000 @@ -33,6 +33,9 @@ - qemu-kvm - sfdisk +Also consider installing pyflakes, which is optional but will enable more +tests. + And run the following command: $ testr init === modified file 'linaro_image_tools/fetch_image.py' --- linaro_image_tools/fetch_image.py 2011-07-27 19:39:57 +0000 +++ linaro_image_tools/fetch_image.py 2011-07-28 13:37:20 +0000 @@ -47,7 +47,6 @@ self.event_queue = None self.to_download = None self.sha1_files = None - self.gpg_files = None self.downloaded_files = None self.sig_files = None self.verified_files = None @@ -382,8 +381,8 @@ self.to_download = self.generate_download_list() gpg_urls = [f for f in self.to_download if re.search('\.asc$', f)] - gpg_files = self.download_files(gpg_urls, self.settings, - force_download=force_download) + self.download_files( + gpg_urls, self.settings, force_download=force_download) def _check_downloads(self): self.get_sig_files() @@ -475,10 +474,10 @@ else: print "Re-downloading corrupt files" # There are some files to re-download - redownloaded_files = self.download_files( - to_retry, self.settings, - self.event_queue, - force_download=True) + self.download_files(to_retry, + self.settings, + self.event_queue, + force_download=True) (self.verified_files, self.gpg_sig_ok) = utils.verify_file_integrity(self.sig_files) === modified file 'linaro_image_tools/hwpack/builder.py' --- linaro_image_tools/hwpack/builder.py 2011-06-20 13:33:01 +0000 +++ linaro_image_tools/hwpack/builder.py 2011-07-28 10:33:14 +0000 @@ -134,28 +134,30 @@ fetcher = PackageFetcher( sources, architecture=architecture, prefer_label=LOCAL_ARCHIVE_LABEL) - with fetcher, PackageUnpacker() as package_unpacker: - fetcher.ignore_packages(self.config.assume_installed) - packages = fetcher.fetch_packages( - packages, download_content=self.config.include_debs) - - if self.config.u_boot_package is not None: - u_boot_package = self.find_fetched_package( - packages, self.config.u_boot_package) - hwpack.metadata.u_boot = self.add_file_to_hwpack( - u_boot_package, self.config.u_boot_file, - package_unpacker, hwpack, hwpack.U_BOOT_DIR) - - logger.debug("Adding packages to hwpack") - hwpack.add_packages(packages) - for local_package in local_packages: - if local_package not in packages: - logger.warning( - "Local package '%s' not included", - local_package.name) - hwpack.add_dependency_package(self.config.packages) - with open(hwpack.filename(), 'w') as f: - hwpack.to_file(f) - logger.info("Wrote %s" % hwpack.filename()) - with open(hwpack.filename('.manifest.txt'), 'w') as f: - f.write(hwpack.manifest_text()) + with fetcher: + with PackageUnpacker() as package_unpacker: + fetcher.ignore_packages(self.config.assume_installed) + packages = fetcher.fetch_packages( + packages, + download_content=self.config.include_debs) + + if self.config.u_boot_package is not None: + u_boot_package = self.find_fetched_package( + packages, self.config.u_boot_package) + hwpack.metadata.u_boot = self.add_file_to_hwpack( + u_boot_package, self.config.u_boot_file, + package_unpacker, hwpack, hwpack.U_BOOT_DIR) + + logger.debug("Adding packages to hwpack") + hwpack.add_packages(packages) + for local_package in local_packages: + if local_package not in packages: + logger.warning( + "Local package '%s' not included", + local_package.name) + hwpack.add_dependency_package(self.config.packages) + with open(hwpack.filename(), 'w') as f: + hwpack.to_file(f) + logger.info("Wrote %s" % hwpack.filename()) + with open(hwpack.filename('.manifest.txt'), 'w') as f: + f.write(hwpack.manifest_text()) === modified file 'linaro_image_tools/media_create/tests/test_media_create.py' --- linaro_image_tools/media_create/tests/test_media_create.py 2011-07-26 15:20:56 +0000 +++ linaro_image_tools/media_create/tests/test_media_create.py 2011-07-28 10:43:00 +0000 @@ -2068,6 +2068,8 @@ with partition_mounted('foo', 'bar'): pass test_func() + expected = ['sudo -E mount foo bar', 'sync'] + self.assertEqual(expected, popen_fixture.mock.commands_executed) class TestPopulateBoot(TestCaseWithFixtures): === modified file 'linaro_image_tools/tests/test_pyflakes.py' --- linaro_image_tools/tests/test_pyflakes.py 2011-06-21 09:18:32 +0000 +++ linaro_image_tools/tests/test_pyflakes.py 2011-07-28 10:44:05 +0000 @@ -29,8 +29,8 @@ (stdout, stderr) = proc.communicate() stdout = stdout.splitlines() stdout.sort() - expected = ["./linaro_image_tools/utils.py:27: redefinition of " - "unused 'CommandNotFound' from line 25" ] + expected = ["./linaro_image_tools/utils.py:29: redefinition of " + "unused 'CommandNotFound' from line 27" ] self.assertEquals(expected, stdout) self.assertEquals('', stderr)