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.
This commit is contained in:
Jonh Wendell 2015-03-03 19:39:58 -03:00
parent d046c8e1f7
commit 1290694f9a
2 changed files with 8 additions and 3 deletions

View file

@ -121,6 +121,7 @@ properties:
items:
$ref: '#/definitions/absolute_path'
minItems: 1
include-source-type: {type: boolean}
additionalProperties: false
plugins:
type: object

View file

@ -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):