module-puppetlabs-apt/templates/pin.pref.erb
Daniele Sluijters 9f59f1b33a pin: Fix the template.
In APT preferences files the only allowed comments are lines that start
with `Explanation:`, commented lines that start with a # trigger a
myriad of interesting bugs. This is considered a feature of APT.

Because we're only ever writing a single file at a time with only a #
comment at the top we were getting away with this but it shouldn't be
there in the first place.
2014-03-28 08:47:19 +01:00

21 line
718 B
Text

<%-
@pin = "release a=#{@name}" # default value
if @pin_release.length > 0
options = []
options.push("a=#{@release}") if @release.length > 0
options.push("n=#{@codename}") if @codename.length > 0
options.push("v=#{@release_version}") if @release_version.length > 0
options.push("c=#{@component}") if @component.length > 0
options.push("o=#{@originator}") if @originator.length > 0
options.push("l=#{@label}") if @label.length > 0
@pin = "release #{options.join(', ')}"
elsif @version.length > 0
@pin = "version #{@version}"
elsif @origin.length > 0
@pin = "origin #{@origin}"
end
-%>
Explanation: <%= @explanation %>
Package: <%= @packages_string %>
Pin: <%= @pin %>
Pin-Priority: <%= @priority %>