aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2010-10-06 12:09:38 +0200
committerintrigeri <intrigeri@boum.org>2010-10-06 12:09:38 +0200
commit50136de4209478cf3e266ea4fdc8b54928337a29 (patch)
treec466984ff9e42f440bd85b7b97f40595cd931102
parentde94b807ee9495d63d1afe16579bd435826e20f0 (diff)
downloadpuppet-apt-50136de4209478cf3e266ea4fdc8b54928337a29.tar.gz
puppet-apt-50136de4209478cf3e266ea4fdc8b54928337a29.tar.bz2
Add opt-in support for deb-src.
-rw-r--r--README8
-rw-r--r--manifests/init.pp15
-rw-r--r--templates/sources.list.erb12
3 files changed, 30 insertions, 5 deletions
diff --git a/README b/README
index 22de451..b1f98c6 100644
--- a/README
+++ b/README
@@ -83,6 +83,14 @@ If this variable is set to true the Debian Volatile sources are added.
By default this is false for backward compatibility with older
versions of this module.
+$apt_include_src
+----------------
+
+If this variable is set to true a deb-src source is added for every
+added binary archive source.
+By default this is false for backward compatibility with older
+versions of this module.
+
Classes
=======
diff --git a/manifests/init.pp b/manifests/init.pp
index d79e79a..7f52a9c 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -11,16 +11,21 @@ class apt {
default => $apt_clean,
}
- package { apt:
- ensure => installed,
- require => undef,
- }
-
$use_volatile = $apt_use_volatile ? {
'' => false,
default => $apt_use_volatile,
}
+ $include_src = $apt_include_src ? {
+ '' => false,
+ default => $apt_include_src,
+ }
+
+ package { apt:
+ ensure => installed,
+ require => undef,
+ }
+
# init $release, $next_release, $codename, $next_codename
case $lsbdistcodename {
'': {
diff --git a/templates/sources.list.erb b/templates/sources.list.erb
index d3739ff..35fac32 100644
--- a/templates/sources.list.erb
+++ b/templates/sources.list.erb
@@ -4,12 +4,18 @@
# basic
deb <%= http://ftp.debian.org/debian/ %> <%= codename %> <%= repos %>
+<% if include_src then %>
+deb-src <%= http://ftp.debian.org/debian/ %> <%= codename %> <%= repos %>
+<% end %>
# security
<% if (release == "unstable" || release == "experimental") %>
# There is no security support for <%= release %>
<% else %>
deb http://security.debian.org/ <%= codename %>/updates <%= repos %>
+<% if include_src then %>
+deb-src http://security.debian.org/ <%= codename %>/updates <%= repos %>
+<% end %>
<% end %>
# backports
@@ -17,6 +23,9 @@ deb http://security.debian.org/ <%= codename %>/updates <%= repos %>
# There is no backports archive for <%= release %>
<% else %>
deb http://backports.debian.org/debian-backports/ <%= codename %>-backports <%= repos %>
+<% if include_src then %>
+deb-src http://backports.debian.org/debian-backports/ <%= codename %>-backports <%= repos %>
+<% end %>
<% end %>
<% if use_volatile %>
@@ -25,6 +34,9 @@ deb http://backports.debian.org/debian-backports/ <%= codename %>-backports <%=
# There is no volatile archive for <%= release %>
<% else %>
deb http://volatile.debian.org/debian-volatile/ <%= codename %>/volatile <%= repos %>
+<% if include_src then %>
+deb-src http://volatile.debian.org/debian-volatile/ <%= codename %>/volatile <%= repos %>
+<% end %>
<% end %>
<% end %>