diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-15 18:34:00 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-15 18:34:00 +0000 |
| commit | 8602932432c62630ec47a672fb79d6aa90dcbfc7 (patch) | |
| tree | c374f0b0f2304149182b6813f4b3ea7d11f65991 /lib/puppet | |
| parent | d1cd443e9644f945f5c55b592a2414dbaef2de5f (diff) | |
| download | puppet-8602932432c62630ec47a672fb79d6aa90dcbfc7.tar.gz puppet-8602932432c62630ec47a672fb79d6aa90dcbfc7.tar.xz puppet-8602932432c62630ec47a672fb79d6aa90dcbfc7.zip | |
Changing "answerfile" to "adminfile", adding "responsefile", and autorequiring both.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@913 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/type/package.rb | 36 | ||||
| -rwxr-xr-x | lib/puppet/type/package/sun.rb | 12 |
2 files changed, 38 insertions, 10 deletions
diff --git a/lib/puppet/type/package.rb b/lib/puppet/type/package.rb index 65bb93993..82afb86a5 100644 --- a/lib/puppet/type/package.rb +++ b/lib/puppet/type/package.rb @@ -168,8 +168,8 @@ module Puppet return true end else - self.debug "@is is %s, latest %s is %s" % - [@is, @parent.name, latest] + #self.debug "@is is %s, latest %s is %s" % + # [@is, @parent.name, latest] end when :absent if @is == :absent @@ -280,12 +280,19 @@ module Puppet desc "A read-only parameter set by the package." end - newparam(:answerfile) do + newparam(:adminfile) do + desc "A file containing package defaults for installing packages. + This is currently only used on Solaris. The value will be + validated according to system rules, which in the case of + Solaris means that it should either be a fully qualified path + or it should be in /var/sadm/install/admin." + end + + newparam(:responsefile) do desc "A file containing any necessary answers to questions asked by the package. This is currently only used on Solaris. The - value will be validated according to system rules, which in - the case of Solaris means that it should either be a fully qualified - path or it should be in /var/sadm/install/admin." + value will be validated according to system rules, but it should + generally be a fully qualified path." end # FIXME Version is screwy -- most package systems can't specify a @@ -321,6 +328,23 @@ module Puppet newparam(:description) do desc "A read-only parameter set by the package." end + + autorequire(:file) do + autos = [] + [:responsefile, :adminfile].each { |param| + if val = self[param] + autos << val + end + } + + if source = self[:source] + if source =~ /^#{File::SEPARATOR}/ + autos << source + end + end + autos + end + @listed = false @allowedmethods = [:types] diff --git a/lib/puppet/type/package/sun.rb b/lib/puppet/type/package/sun.rb index 0c2b50b9d..2a04a9e1f 100755 --- a/lib/puppet/type/package/sun.rb +++ b/lib/puppet/type/package/sun.rb @@ -7,8 +7,12 @@ module Puppet #cmd = "pkgadd -d %s -n %s 2>&1" % [self[:source], self[:name]] cmd = ["pkgadd"] - if self[:answerfile] - cmd += ["-a", self[:answerfile]] + if self[:adminfile] + cmd += ["-a", self[:adminfile]] + end + + if self[:responsefile] + cmd += ["-r", self[:responsefile]] end cmd += ["-d", self[:source]] @@ -34,6 +38,7 @@ module Puppet "BASEDIR" => :root, "HOTLINE" => nil, "EMAIL" => nil, + "VSTOCK" => nil, "VENDOR" => :vendor, "DESC" => :description, "PSTAMP" => nil, @@ -59,8 +64,7 @@ module Puppet hash[names[name]] = value end else - self.err "'pkginfo' returned invalid name %s" % - name + self.notice "Ignoring unknown name %s" % name end when /\s+\d+.+/: # nothing; we're ignoring the FILES info |
