diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2013-05-10 12:28:58 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2013-05-10 12:28:58 -0500 |
commit | e55b0dc3b96cdac318dcf07309d18e763ccb7229 (patch) | |
tree | 35e65ffc784b5579e22fa0c4e6a5e5d8576fdff8 | |
parent | 4f745cc2731f7035f02566ba8bc1a0e9ae1b1a71 (diff) | |
download | bcfg2-e55b0dc3b96cdac318dcf07309d18e763ccb7229.tar.gz bcfg2-e55b0dc3b96cdac318dcf07309d18e763ccb7229.tar.bz2 bcfg2-e55b0dc3b96cdac318dcf07309d18e763ccb7229.zip |
APT: Allow specification of deb-src lines (Resolves #1148)
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
-rw-r--r-- | doc/server/plugins/generators/packages.txt | 5 | ||||
-rw-r--r-- | schemas/packages.xsd | 9 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Packages/Apt.py | 5 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Packages/Source.py | 4 |
4 files changed, 21 insertions, 2 deletions
diff --git a/doc/server/plugins/generators/packages.txt b/doc/server/plugins/generators/packages.txt index 606e1e128..cdc4f7282 100644 --- a/doc/server/plugins/generators/packages.txt +++ b/doc/server/plugins/generators/packages.txt @@ -252,7 +252,8 @@ something like this: <Group name="ubuntu-intrepid"> <Source type="apt" url="http://us.archive.ubuntu.com/ubuntu" - version="intrepid"> + version="intrepid" + debsrc="true"> <Component>main</Component> <Component>universe</Component> <Arch>i386</Arch> @@ -280,7 +281,7 @@ something like this: .. warning:: You must regenerate the Packages cache when adding or removing the recommended attribute (``bcfg2-admin xcmd - Packages.Refresh``). + Packages.Refresh``). .. [#f1] Bcfg2 will by default add **Essential** packages to the client specification. You can disable this behavior by diff --git a/schemas/packages.xsd b/schemas/packages.xsd index dbee2f31b..e538bb0e7 100644 --- a/schemas/packages.xsd +++ b/schemas/packages.xsd @@ -167,6 +167,15 @@ </xsd:documentation> </xsd:annotation> </xsd:attribute> + <xsd:attribute type="xsd:boolean" name="debsrc"> + <xsd:annotation> + <xsd:documentation> + Include ``deb-src`` lines in the generated APT + configuration. This only applies to sources with + :xml:attribute:`SourceType:type` = ``apt``. + </xsd:documentation> + </xsd:annotation> + </xsd:attribute> <xsd:attribute type="xsd:string" name="url"> <xsd:annotation> <xsd:documentation> diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Apt.py b/src/lib/Bcfg2/Server/Plugins/Packages/Apt.py index bc2928fa6..a82a183d8 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Apt.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Apt.py @@ -40,6 +40,11 @@ class AptCollection(Collection): else: lines.append("deb %s %s %s" % (source.url, source.version, " ".join(source.components))) + if source.debsrc: + lines.append("deb-src %s %s %s" % + (source.url, + source.version, + " ".join(source.components))) lines.append("") return "\n".join(lines) diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py index 7ba374dd3..22073493c 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py @@ -158,6 +158,10 @@ class Source(Bcfg2.Server.Plugin.Debuggable): # pylint: disable=R0902 #: this source self.whitelist = [item.text for item in xsource.findall('Whitelist')] + #: Whether or not to include deb-src lines in the generated APT + #: configuration + self.debsrc = xsource.get('debsrc', 'false') == 'true' + #: A dict of repository options that will be included in the #: configuration generated on the server side (if such is #: applicable; most backends do not generate any sort of |