=== 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)
 

