$package = $name,
$ensure = 'present',
$source = '',
- $release,
+ $release = '',
+ $pin = '',
$priority )
{
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}":
# 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: {