~nvalcarcel/ubuntu/lucid/puppet/fix-546677

« back to all changes in this revision

Viewing changes to lib/puppet/type/package.rb

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-12-23 00:48:10 UTC
  • mfrom: (1.1.10 upstream) (3.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091223004810-3i4oryds922g5n59
Tags: 0.25.1-3ubuntu1
* Merge from debian testing.  Remaining changes:
  - debian/rules:
    + Don't start puppet when first installing puppet.
  - debian/puppet.conf, lib/puppet/defaults.rb:
    + Move templates to /etc/puppet
  - lib/puppet/defaults.rb:
    + Fix /var/lib/puppet/state ownership.
  - man/man8/puppet.conf.8: 
    + Fix broken URL in manpage.
  - debian/control:
    + Update maintainer accordint to spec.
    + Puppetmaster Recommends -> Suggests
    + Created puppet-testsuite as a seperate. Allow the users to run puppet's 
      testsuite.
  - tests/Rakefile: Fix rakefile so that the testsuite can acutally be ran.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
            newvalue(:absent, :event => :package_removed) do
56
56
                provider.uninstall
57
57
            end
58
 
            
 
58
 
59
59
            newvalue(:purged, :event => :package_purged, :required_features => :purgeable) do
60
60
                provider.purge
61
61
            end
115
115
                    when :latest
116
116
                        # Short-circuit packages that are not present
117
117
                        return false if is == :absent or is == :purged
118
 
 
 
118
 
119
119
                        # Don't run 'latest' more than about every 5 minutes
120
120
                        if @latest and ((Time.now.to_i - @lateststamp) / 60) < 5
121
121
                            #self.debug "Skipping latest check"
131
131
                        end
132
132
 
133
133
                        case is
134
 
                        when @latest:
 
134
                        when @latest
135
135
                            return true
136
 
                        when :present:
 
136
                        when :present
137
137
                            # This will only happen on retarded packaging systems
138
138
                            # that can't query versions.
139
139
                            return true
202
202
                    alias => openssh,
203
203
                    require => Package[openssl]
204
204
                }
205
 
            
 
205
 
206
206
            "
207
207
            isnamevar
208
208
        end
306
306
            @provider.get(:ensure) != :absent
307
307
        end
308
308
 
309
 
        def initialize(params)
310
 
            self.initvars
311
 
            provider = nil
312
 
            [:provider, "use"].each { |label|
313
 
                if params.include?(label)
314
 
                    provider = params[label]
315
 
                    params.delete(label)
316
 
                end
317
 
            }
318
 
            if provider
319
 
                self[:provider] = provider
320
 
            else
321
 
                self.setdefaults(:provider)
322
 
            end
323
 
 
324
 
            super(params)
325
 
 
326
 
            unless @parameters.include?(:provider)
327
 
                raise Puppet::DevError, "No package provider set"
328
 
            end
329
 
        end
330
 
 
331
309
        def retrieve
332
310
            @provider.properties.inject({}) do |props, ary|
333
311
                name, value = ary
337
315
                props
338
316
            end
339
317
        end
340
 
    end # Puppet.type(:package)
 
318
    end # Puppet::Type.type(:package)
341
319
end
342
320