equal
deleted
inserted
replaced
132 origins |
132 origins |
133 end |
133 end |
134 |
134 |
135 def build_flags |
135 def build_flags |
136 flags = [] |
136 flags = [] |
137 if enable = @resource[:enable] and enable != nil |
|
138 if enable == :true |
|
139 flags << "--enable" |
|
140 elsif enable == :false |
|
141 flags << "--disable" |
|
142 end |
|
143 end |
|
144 |
137 |
145 if searchfirst = @resource[:searchfirst] and searchfirst != "" |
138 if searchfirst = @resource[:searchfirst] and searchfirst != "" |
146 if searchfirst == :true |
139 if searchfirst == :true |
147 flags << "--search-first" |
140 flags << "--search-first" |
148 end |
141 end |
234 end |
227 end |
235 |
228 |
236 # required puppet functions |
229 # required puppet functions |
237 def create |
230 def create |
238 pkg("set-publisher", build_flags, build_origin, @resource[:name]) |
231 pkg("set-publisher", build_flags, build_origin, @resource[:name]) |
|
232 # pkg(5) does not allow for a new publisher to be set with the disabled |
|
233 # flag, so check for it after setting the publisher |
|
234 if enable = @resource[:enable] and enable != nil |
|
235 if enable == :false |
|
236 pkg("set-publisher", "--disable", @resource[:name]) |
|
237 end |
|
238 end |
239 end |
239 end |
240 |
240 |
241 def destroy |
241 def destroy |
242 pkg("unset-publisher", @resource[:name]) |
242 pkg("unset-publisher", @resource[:name]) |
243 end |
243 end |