summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2012-06-08 18:30:23 +0200
committerintrigeri <intrigeri@boum.org>2012-06-08 18:30:23 +0200
commit2e4d22ddd948b6d6f1532654e3dea53fa4b9f7d1 (patch)
tree273d8f82a71af7fbcac5f17f7ac21c2c403ad638 /manifests
parent13a0b4484fc85be0821f0b72c11c9487c890b546 (diff)
Allow passing arbitrary Pin value to apt::preferences_snippet.
Closes: Redmine#3467.
Diffstat (limited to 'manifests')
-rw-r--r--manifests/preferences_snippet.pp23
1 files changed, 20 insertions, 3 deletions
diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp
index 908ca73..e00c4d1 100644
--- a/manifests/preferences_snippet.pp
+++ b/manifests/preferences_snippet.pp
@@ -2,7 +2,8 @@ define apt::preferences_snippet(
$package = $name,
$ensure = 'present',
$source = '',
- $release,
+ $release = '',
+ $pin = '',
$priority )
{
@@ -10,6 +11,13 @@ define apt::preferences_snippet(
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}":
@@ -22,8 +30,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: {