Sha256: 982d4fdf8abbccbebf6d5d87e61033a60017f2b50a34b41591e9fb4ea59a6a18

Contents?: true

Size: 881 Bytes

Versions: 10

Compression:

Stored size: 881 Bytes

Contents

Puppet::Type.type(:package).provide :aptitude, :parent => :apt, :source => :dpkg do
    desc "Package management via ``aptitude``."

    has_feature :versionable

    commands :aptitude => "/usr/bin/aptitude"
    commands :aptcache => "/usr/bin/apt-cache"

    ENV['DEBIAN_FRONTEND'] = "noninteractive"

    def aptget(*args)
        args.flatten!
        # Apparently aptitude hasn't always supported a -q flag.
        if args.include?("-q")
            args.delete("-q")
        end
        output = aptitude(*args)

        # Yay, stupid aptitude doesn't throw an error when the package is missing.
        if args.include?(:install) and output =~ /Couldn't find any package/
            raise Puppet::Error.new(
                "Could not find package %s" % self.name
            )
        end
    end

    def purge
        aptitude '-y', 'purge', @resource[:name]
	end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
puppet-0.24.9 lib/puppet/provider/package/aptitude.rb
puppet-0.24.0 lib/puppet/provider/package/aptitude.rb
puppet-0.24.1 lib/puppet/provider/package/aptitude.rb
puppet-0.24.3 lib/puppet/provider/package/aptitude.rb
puppet-0.24.4 lib/puppet/provider/package/aptitude.rb
puppet-0.24.2 lib/puppet/provider/package/aptitude.rb
puppet-0.24.6 lib/puppet/provider/package/aptitude.rb
puppet-0.24.5 lib/puppet/provider/package/aptitude.rb
puppet-0.24.7 lib/puppet/provider/package/aptitude.rb
puppet-0.24.8 lib/puppet/provider/package/aptitude.rb