[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5
Dominic Cleal
dcleal at redhat.com
Tue May 10 08:02:43 UTC 2011
The following commit has been merged in the experimental branch:
commit f8e9155926188f66c1918b51950686d3abad8b78
Author: Dominic Cleal <dcleal at redhat.com>
Date: Mon Nov 29 12:40:19 2010 +0000
Removing blastwave references and unused PAGER
diff --git a/lib/puppet/provider/package/pkgutil.rb b/lib/puppet/provider/package/pkgutil.rb
index 4e2c0d9..b9d0ea4 100755
--- a/lib/puppet/provider/package/pkgutil.rb
+++ b/lib/puppet/provider/package/pkgutil.rb
@@ -10,9 +10,6 @@ Puppet::Type.type(:package).provide :pkgutil, :parent => :sun, :source => :sun d
commands :pkguti => pkguti
- # This is so stupid, but then, so is blastwave.
- ENV["PAGER"] = "/usr/bin/cat"
-
def self.extended(mod)
unless command(:pkguti) != "pkgutil"
raise Puppet::Error,
@@ -26,14 +23,15 @@ Puppet::Type.type(:package).provide :pkgutil, :parent => :sun, :source => :sun d
end
def self.instances(hash = {})
- blastlist(hash).collect do |bhash|
+ pkglist(hash).collect do |bhash|
bhash.delete(:avail)
new(bhash)
end
end
- # Turn our blastwave listing into a bunch of hashes.
- def self.blastlist(hash)
+ # Turn our pkgutil -c listing into a bunch of hashes.
+ # Supports :justme => packagename, which uses the optimised --single arg
+ def self.pkglist(hash)
command = ["-c"]
if hash[:justme]
@@ -53,7 +51,7 @@ Puppet::Type.type(:package).provide :pkgutil, :parent => :sun, :source => :sun d
next if line =~ /^=+> / # catalog fetch
next if line =~ /\d+:\d+:\d+ URL:/ # wget without -q
- parsed = blastsplit(line)
+ parsed = pkgsplit(line)
# When finding one package, ensure we picked up the package line
# itself, not any pkgutil noise.
@@ -74,7 +72,7 @@ Puppet::Type.type(:package).provide :pkgutil, :parent => :sun, :source => :sun d
end
# Split the different lines into hashes.
- def self.blastsplit(line)
+ def self.pkgsplit(line)
if line =~ /\s*(\S+)\s+(\S+)\s+(.*)/
hash = {}
hash[:name] = $1
@@ -105,12 +103,12 @@ Puppet::Type.type(:package).provide :pkgutil, :parent => :sun, :source => :sun d
# Retrieve the version from the current package file.
def latest
- hash = self.class.blastlist(:justme => @resource[:name])
+ hash = self.class.pkglist(:justme => @resource[:name])
hash[:avail]
end
def query
- if hash = self.class.blastlist(:justme => @resource[:name])
+ if hash = self.class.pkglist(:justme => @resource[:name])
hash
else
{:ensure => :absent}
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list