From 1290694f9a6fc65ecc00ed6748a3b61442c489c6 Mon Sep 17 00:00:00 2001 From: Jonh Wendell Date: Tue, 3 Mar 2015 19:39:58 -0300 Subject: [PATCH] Add the manifest "include-source-type" key for packages object It controls whether to include the 'deb-src' lines in image's source.list. Currently they are always included. This patch changes this behavior by not including them by default; the user must set this new config to true in order to include them. This saves a bit of bandwidth in default installations. Also, the use of src packages is not so usual in ordinary installations. --- bootstrapvz/base/manifest-schema.yml | 1 + bootstrapvz/common/tasks/apt.py | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bootstrapvz/base/manifest-schema.yml b/bootstrapvz/base/manifest-schema.yml index a49d2fa..229feb6 100644 --- a/bootstrapvz/base/manifest-schema.yml +++ b/bootstrapvz/base/manifest-schema.yml @@ -121,6 +121,7 @@ properties: items: $ref: '#/definitions/absolute_path' minItems: 1 + include-source-type: {type: boolean} additionalProperties: false plugins: type: object diff --git a/bootstrapvz/common/tasks/apt.py b/bootstrapvz/common/tasks/apt.py index 298a956..f009469 100644 --- a/bootstrapvz/common/tasks/apt.py +++ b/bootstrapvz/common/tasks/apt.py @@ -24,14 +24,18 @@ class AddDefaultSources(Task): @classmethod def run(cls, info): + include_src = info.manifest.packages.get('include-source-type', False) components = ' '.join(info.manifest.packages.get('components', ['main'])) info.source_lists.add('main', 'deb {apt_mirror} {system.release} ' + components) - info.source_lists.add('main', 'deb-src {apt_mirror} {system.release} ' + components) + if include_src: + info.source_lists.add('main', 'deb-src {apt_mirror} {system.release} ' + components) if info.release_codename != 'sid': 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 include_src: + info.source_lists.add('main', 'deb-src http://security.debian.org/ {system.release}/updates ' + components) 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) + if include_src: + info.source_lists.add('main', 'deb-src {apt_mirror} {system.release}-updates ' + components) class AddBackports(Task):