From b25e607388fdaf76f11b4709c5a92561f2737923 Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Sat, 3 May 2014 21:57:12 +0200 Subject: [PATCH] Move "sections" setting into "packages" section. Rename it to "components", which is the real name for it (see http://manpages.debian.org/cgi-bin/man.cgi?query=sources.list). --- bootstrapvz/base/manifest-schema.json | 9 +++++---- bootstrapvz/common/tasks/apt.py | 18 +++++++++--------- bootstrapvz/providers/gce/tasks/apt.py | 14 +++++++------- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/bootstrapvz/base/manifest-schema.json b/bootstrapvz/base/manifest-schema.json index fd0a772..36fc166 100644 --- a/bootstrapvz/base/manifest-schema.json +++ b/bootstrapvz/base/manifest-schema.json @@ -26,10 +26,6 @@ "type": "object", "properties": { "release": { "enum": ["squeeze", "wheezy", "jessie", "testing", "unstable"] }, - "sections": { - "type": "array", - "minItems": 1 - }, "architecture": { "enum": ["i386", "amd64"] }, "bootloader": { "enum": ["pvgrub", "grub", "extlinux"] }, "timezone": { "type": "string" }, @@ -61,6 +57,11 @@ "additionalProperties": false, "minItems": 1 }, + "components": { + "type": "array", + "items": {"type": "string"}, + "minItems": 1 + }, "preferences": { "type": "object", "patternProperties": { diff --git a/bootstrapvz/common/tasks/apt.py b/bootstrapvz/common/tasks/apt.py index 40faa53..15d1ea2 100644 --- a/bootstrapvz/common/tasks/apt.py +++ b/bootstrapvz/common/tasks/apt.py @@ -23,16 +23,16 @@ class AddDefaultSources(Task): @classmethod def run(cls, info): - sections = 'main' - if 'sections' in info.manifest.system: - sections = ' '.join(info.manifest.system['sections']) - info.source_lists.add('main', 'deb {apt_mirror} {system.release} ' + sections) - info.source_lists.add('main', 'deb-src {apt_mirror} {system.release} ' + sections) - info.source_lists.add('main', 'deb http://security.debian.org/ {system.release}/updates ' + sections) - info.source_lists.add('main', 'deb-src http://security.debian.org/ {system.release}/updates ' + sections) + components = 'main' + if 'components' in info.manifest.system: + components = ' '.join(info.manifest.system['components']) + info.source_lists.add('main', 'deb {apt_mirror} {system.release} ' + components) + info.source_lists.add('main', 'deb-src {apt_mirror} {system.release} ' + components) + info.source_lists.add('main', 'deb http://security.debian.org/ {system.release}/updates ' + components) + info.source_lists.add('main', 'deb-src http://security.debian.org/ {system.release}/updates ' + components) if info.manifest.system['release'] not in {'testing', 'unstable'}: - info.source_lists.add('main', 'deb {apt_mirror} {system.release}-updates ' + sections) - info.source_lists.add('main', 'deb-src {apt_mirror} {system.release}-updates ' + sections) + info.source_lists.add('main', 'deb {apt_mirror} {system.release}-updates ' + components) + info.source_lists.add('main', 'deb-src {apt_mirror} {system.release}-updates ' + components) class AddManifestPreferences(Task): diff --git a/bootstrapvz/providers/gce/tasks/apt.py b/bootstrapvz/providers/gce/tasks/apt.py index fb6b38f..733c1c6 100644 --- a/bootstrapvz/providers/gce/tasks/apt.py +++ b/bootstrapvz/providers/gce/tasks/apt.py @@ -12,13 +12,13 @@ class SetPackageRepositories(Task): @classmethod def run(cls, info): - sections = 'main' - if 'sections' in info.manifest.system: - sections = ' '.join(info.manifest.system['sections']) - info.source_lists.add('main', 'deb http://http.debian.net/debian {system.release} ' + sections) - info.source_lists.add('main', 'deb-src http://http.debian.net/debian {system.release} ' + sections) - info.source_lists.add('backports', 'deb http://http.debian.net/debian {system.release}-backports ' + sections) - info.source_lists.add('backports', 'deb-src http://http.debian.net/debian {system.release}-backports ' + sections) + components = 'main' + if 'components' in info.manifest.system: + components = ' '.join(info.manifest.system['components']) + info.source_lists.add('main', 'deb http://http.debian.net/debian {system.release} ' + components) + info.source_lists.add('main', 'deb-src http://http.debian.net/debian {system.release} ' + components) + info.source_lists.add('backports', 'deb http://http.debian.net/debian {system.release}-backports ' + components) + info.source_lists.add('backports', 'deb-src http://http.debian.net/debian {system.release}-backports ' + components) info.source_lists.add('goog', 'deb http://goog-repo.appspot.com/debian pigeon main')