aboutsummaryrefslogtreecommitdiff
path: root/hwpack
diff options
context:
space:
mode:
authorMichael Hudson <michael.hudson@linaro.org>2010-12-17 12:27:16 +1300
committerMichael Hudson <michael.hudson@linaro.org>2010-12-17 12:27:16 +1300
commit2f69a87c2b7b5b20beb99dcb8dd3e1d41844de81 (patch)
treeb5518a5005384be0d1e20a75b903269da224a18a /hwpack
parent4c46ba6bb5a81f90871c7818d6b0f21eb12e00b2 (diff)
remove special casing of None keys in HardwarePack.sources
Diffstat (limited to 'hwpack')
-rw-r--r--hwpack/builder.py14
-rw-r--r--hwpack/hardwarepack.py2
-rw-r--r--hwpack/tests/test_hardwarepack.py11
3 files changed, 8 insertions, 19 deletions
diff --git a/hwpack/builder.py b/hwpack/builder.py
index 8450604..33f7dc8 100644
--- a/hwpack/builder.py
+++ b/hwpack/builder.py
@@ -46,16 +46,18 @@ class HardwarePackBuilder(object):
hwpack = HardwarePack(metadata)
sources = self.config.sources
with LocalArchiveMaker() as local_archive_maker:
+ hwpack.add_apt_sources(sources)
+ sources = sources.values()
if self.local_debs:
- sources[None] = (
+ packages = [
+ FetchedPackage.from_deb(deb)
+ for deb in self.local_debs]
+ sources.append(
local_archive_maker.sources_entry_for_debs(
- [FetchedPackage.from_deb(deb)
- for deb in self.local_debs],
- LOCAL_ARCHIVE_LABEL))
- hwpack.add_apt_sources(sources)
+ packages, LOCAL_ARCHIVE_LABEL))
logger.info("Fetching packages")
fetcher = PackageFetcher(
- sources.values(), architecture=architecture,
+ sources, architecture=architecture,
prefer_label=LOCAL_ARCHIVE_LABEL)
with fetcher:
fetcher.ignore_packages(self.config.assume_installed)
diff --git a/hwpack/hardwarepack.py b/hwpack/hardwarepack.py
index 473ff35..2891eba 100644
--- a/hwpack/hardwarepack.py
+++ b/hwpack/hardwarepack.py
@@ -217,8 +217,6 @@ class HardwarePack(object):
[p for p in self.packages if p.content is not None]))
tf.create_dir(self.SOURCES_LIST_DIRNAME)
for source_name, source_info in self.sources.items():
- if source_name is None:
- continue
tf.create_file_from_string(
self.SOURCES_LIST_DIRNAME + "/" + source_name + ".list",
"deb " + source_info + "\n")
diff --git a/hwpack/tests/test_hardwarepack.py b/hwpack/tests/test_hardwarepack.py
index b5cb649..786d985 100644
--- a/hwpack/tests/test_hardwarepack.py
+++ b/hwpack/tests/test_hardwarepack.py
@@ -337,17 +337,6 @@ class HardwarePackTests(TestCase):
tf, HardwarePackHasFile("sources.list.d/ubuntu.list",
content="deb " + source + "\n"))
- def test_adds_sources_list_file_ignores_none_keys(self):
- hwpack = HardwarePack(self.metadata)
- source = 'http://example.org/ ubuntu'
- hwpack.add_apt_sources({
- 'ubuntu': source, None: 'file:///local ./'})
- tf = self.get_tarfile(hwpack)
- self.assertThat(
- tf, HardwarePackHasFile(
- "sources.list.d", type=tarfile.DIRTYPE,
- content=["ubuntu.list"]))
-
def test_adds_multiple_sources_list_files(self):
hwpack = HardwarePack(self.metadata)
source1 = 'http://example.org/ ubuntu main universe'