[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Maciej Blizinski maciej at opencsw.org
Tue May 10 07:58:48 UTC 2011


The following commit has been merged in the experimental branch:
commit 919638ec97568536f90e23b9c63a35a134e948a4
Merge: e02ba01613a5ce61ccd6c80c17d53134daf589ba d026bb7c963f992e378ade5e0586242f506c62c7
Author: Maciej Blizinski <maciej at opencsw.org>
Date:   Thu Jul 22 13:16:50 2010 +0200

    Resolved a conflict in the pkgutil provider.

diff --combined lib/puppet/provider/package/pkgutil.rb
index c2489cc,b8ad548..b8ad548
mode 100755,100644..100755
--- a/lib/puppet/provider/package/pkgutil.rb
+++ b/lib/puppet/provider/package/pkgutil.rb
@@@ -1,27 -1,30 +1,30 @@@
- # Packaging using pkgutil from http://pkgutil.wikidot.com/
- # vim:set sw=4 ts=4 sts=4:
+ # Packaging using Peter Bonivart's pkgutil program.
  Puppet::Type.type(:package).provide :pkgutil, :parent => :sun, :source => :sun do
-     desc "Package management using ``pkgutil`` command on Solaris."
-     pkgutil = "pkgutil"
+     desc "Package management using Peter Bonivart's ``pkgutil`` command on Solaris."
+     pkguti = "pkgutil"
      if FileTest.executable?("/opt/csw/bin/pkgutil")
-         pkgutil = "/opt/csw/bin/pkgutil"
+         pkguti = "/opt/csw/bin/pkgutil"
      end
  
      confine :operatingsystem => :solaris
  
-     commands :pkgutil => pkgutil
+     commands :pkguti => pkguti
  
-     # This is so stupid, but then, so is Solaris.
+     # This is so stupid, but then, so is blastwave.
      ENV["PAGER"] = "/usr/bin/cat"
  
      def self.extended(mod)
-         unless command(:pkgutil) != "pkgutil"
+         unless command(:pkguti) != "pkgutil"
              raise Puppet::Error,
                  "The pkgutil command is missing; pkgutil packaging unavailable"
          end
+ 
+         unless FileTest.exists?("/var/opt/csw/pkgutil/admin")
+             Puppet.notice "It is highly recommended you create '/var/opt/csw/pkgutil/admin'."
+             Puppet.notice "See /var/opt/csw/pkgutil"
+         end
      end
  
-     # It's a class method. Returns a list of instances of this class.
      def self.instances(hash = {})
          blastlist(hash).collect do |bhash|
              bhash.delete(:avail)
@@@ -29,21 -32,24 +32,24 @@@
          end
      end
  
-     # Turn our pkgutil listing into a bunch of hashes.
+     # Turn our blastwave listing into a bunch of hashes.
      def self.blastlist(hash)
          command = ["-c"]
  
          if hash[:justme]
+             # The --single option speeds up the execution, because it queries
+             # the package managament system for one package only.
              command << ["--single"]
              command << hash[:justme]
          end
  
-         output = pkgutil command
+         output = pkguti command
  
          list = output.split("\n").collect do |line|
              next if line =~ /^#/
              next if line =~ /^WARNING/
              next if line =~ /localrev\s+remoterev/
+             next if line =~ /installed\s+catalog/
  
              blastsplit(line)
          end.reject { |h| h.nil? }
@@@ -86,10 -92,10 +92,10 @@@
      end
  
      def install
-         pkgutil "-y", "--install", @resource[:name]
+         pkguti "-y", "-i", @resource[:name]
      end
  
-     # What's the latest version of the package available?
+     # Retrieve the version from the current package file.
      def latest
          hash = self.class.blastlist(:justme => @resource[:name])
          hash[:avail]
@@@ -105,10 -111,10 +111,10 @@@
  
      # Remove the old package, and install the new one
      def update
-         pkgutil "-y", "--upgrade", @resource[:name]
+         pkguti "-y", "-i", @resource[:name]
      end
  
      def uninstall
-         pkgutil "-y", "--remove", @resource[:name]
+         pkguti "-y", "-r", @resource[:name]
      end
  end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list