diff options
author | mh <mh@immerda.ch> | 2012-08-16 09:35:21 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2012-08-16 09:35:21 +0200 |
commit | 0c2f31b5d5c972c179cb06ea1a06e6e0e7b1b262 (patch) | |
tree | 55e38dde8d7f0fce7a08fb39774084e724e1a2e3 /manifests/preferences_snippet.pp | |
parent | f823fcd5b7408d7d690cfc5c5063e28db06271a4 (diff) | |
parent | 4f433dbd5238e6b5211d3b0f240ff58031c3da2b (diff) |
Merge remote-tracking branch 'shared/master'
Conflicts:
README
manifests/dist_upgrade/initiator.pp
manifests/init.pp
manifests/preseeded_package.pp
manifests/unattended_upgrades.pp
Diffstat (limited to 'manifests/preferences_snippet.pp')
-rw-r--r-- | manifests/preferences_snippet.pp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp index 91b3dde..6a8e6bc 100644 --- a/manifests/preferences_snippet.pp +++ b/manifests/preferences_snippet.pp @@ -1,14 +1,28 @@ define apt::preferences_snippet( + $package = false, $ensure = 'present', $source = '', - $release, + $release = '', + $pin = '', $priority ) { + $real_package = $package ? { + false => $name, + default => $package, + } + if $custom_preferences == false { fail("Trying to define a preferences_snippet with \$custom_preferences set to false.") } + if !$pin and !$release { + fail("apt::preferences_snippet requires one of the 'pin' or 'release' argument to be set") + } + if $pin and $release { + fail("apt::preferences_snippet requires either a 'pin' or 'release' argument, not both") + } + include apt::preferences concat::fragment{"apt_preference_${name}": @@ -21,8 +35,17 @@ define apt::preferences_snippet( # lenny, we can't generalize without going into ugly special-casing. case $source { '': { - Concat::Fragment["apt_preference_${name}"]{ - content => template("apt/preferences_snippet.erb") + case $release { + '': { + Concat::Fragment["apt_preference_${name}"]{ + content => template("apt/preferences_snippet.erb") + } + } + default: { + Concat::Fragment["apt_preference_${name}"]{ + content => template("apt/preferences_snippet_release.erb") + } + } } } default: { |