diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 402: Create /etc/apt/sources.list.d in IsolatedAptCache. Thanks to Rex Tsai.

Message ID 20110810222315.13481.4415.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

James Westby Aug. 10, 2011, 10:23 p.m. UTC
------------------------------------------------------------
revno: 402
committer: James Westby <james.westby@linaro.org>
branch nick: trunk
timestamp: Wed 2011-08-10 18:12:11 -0400
message:
  Create /etc/apt/sources.list.d in IsolatedAptCache. Thanks to Rex Tsai.
  
  Newer apts require this dir to function, and so we have to create it in
  our temp apt hierarchy.
modified:
  linaro_image_tools/hwpack/packages.py
  linaro_image_tools/hwpack/tests/test_packages.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
diff mbox

Patch

=== modified file 'linaro_image_tools/hwpack/packages.py'
--- linaro_image_tools/hwpack/packages.py	2011-06-20 13:33:01 +0000
+++ linaro_image_tools/hwpack/packages.py	2011-08-10 22:12:11 +0000
@@ -480,7 +480,7 @@ 
         logger.debug("Writing apt configs")
         self.tempdir = tempfile.mkdtemp(prefix="hwpack-apt-cache-")
         dirs = ["var/lib/dpkg",
-                "etc/apt/",
+                "etc/apt/sources.list.d",
                 "var/cache/apt/archives/partial",
                 "var/lib/apt/lists/partial",
                ]

=== modified file 'linaro_image_tools/hwpack/tests/test_packages.py'
--- linaro_image_tools/hwpack/tests/test_packages.py	2011-05-25 20:55:24 +0000
+++ linaro_image_tools/hwpack/tests/test_packages.py	2011-08-10 22:12:11 +0000
@@ -874,6 +874,14 @@ 
             open(os.path.join(
                 cache.tempdir, "etc", "apt", "sources.list")).read())
 
+    def test_prepare_creates_etc_apt_sources_list_dot_d_dir(self):
+        cache = IsolatedAptCache([])
+        self.addCleanup(cache.cleanup)
+        cache.prepare()
+        self.assertTrue(
+            os.path.isdir(os.path.join(
+                cache.tempdir, "etc", "apt", "sources.list.d")))
+
     def test_prepare_with_arch_creates_etc_apt_apt_conf(self):
         cache = IsolatedAptCache([], architecture="arch")
         self.addCleanup(cache.cleanup)