18: def install
19: should = @resource.should(:ensure)
20:
21: if @resource[:source] =~ /\/$/
22: if @resource[:source] =~ /^(ftp|https?):/
23: withenv :PACKAGESITE => @resource[:source] do
24: pkgadd "-r", @resource[:name]
25: end
26: else
27: withenv :PKG_PATH => @resource[:source] do
28: pkgadd @resource[:name]
29: end
30: end
31: else
32: if @resource[:source]
33: Puppet.warning "source is defined but does not have trailing slash, ignoring %s" % @resource[:source]
34: end
35: pkgadd "-r", @resource[:name]
36: end
37: end