FreeBSD Bugzilla – Attachment 114567 Details for
Bug 156239
[maintainer-update] sysutils/puppet: update to 2.6.7 et al
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 11.33 KB, created by
Russell Jackson
on 2011-04-07 06:20:04 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Russell Jackson
Created:
2011-04-07 06:20:04 UTC
Size:
11.33 KB
patch
obsolete
>diff --git a/puppet/Makefile b/puppet/Makefile >index 5539017..866d6f1 100644 >--- a/puppet/Makefile >+++ b/puppet/Makefile >@@ -6,7 +6,8 @@ > # > > PORTNAME= puppet >-PORTVERSION= 2.6.6 >+PORTVERSION= 2.6.7 >+PORTREVISION= 1 > CATEGORIES= sysutils > MASTER_SITES= http://www.puppetlabs.com/downloads/puppet/ > >@@ -50,6 +51,7 @@ RUN_DEPENDS+= rubygem-mongrel>=0:${PORTSDIR}/www/rubygem-mongrel > > .if defined(WITH_PACKAGE_ORIGIN) > EXTRA_PATCHES+= ${FILESDIR}/optpatch-package_origin >+RUN_DEPENDS+= ${RUBY_SITEARCHLIBDIR}/bz2.so:${PORTSDIR}/archivers/ruby-bz2 > .endif > > .include <bsd.port.pre.mk> >diff --git a/puppet/distinfo b/puppet/distinfo >index ed0859f..17dcc99 100644 >--- a/puppet/distinfo >+++ b/puppet/distinfo >@@ -1,2 +1,2 @@ >-SHA256 (puppet-2.6.6.tar.gz) = bc613c2764345947268a080ca0595aa6d4dbb0b9eab65d1476ff6542caf1647a >-SIZE (puppet-2.6.6.tar.gz) = 1514638 >+SHA256 (puppet-2.6.7.tar.gz) = 90c0741f66d15716cfd76f0b8cd15f5b867056f0180ba160ce868350c6dd4ddc >+SIZE (puppet-2.6.7.tar.gz) = 1530756 >diff --git a/puppet/files/optpatch-package_origin b/puppet/files/optpatch-package_origin >index f47dc94..e1cef54 100644 >--- a/puppet/files/optpatch-package_origin >+++ b/puppet/files/optpatch-package_origin >@@ -1,19 +1,24 @@ >-diff --git a/lib/puppet/provider/package/freebsd.rb b/lib/puppet/provider/package/freebsd.rb >-index e10a20b..fbda52d 100755 >+diff --git lib/puppet/provider/package/freebsd.rb lib/puppet/provider/package/freebsd.rb >+index e10a20b..f36e29e 100755 > --- lib/puppet/provider/package/freebsd.rb > +++ lib/puppet/provider/package/freebsd.rb >-@@ -1,36 +1,79 @@ >- Puppet::Type.type(:package).provide :freebsd, :parent => :openbsd do >+@@ -1,37 +1,165 @@ >+-Puppet::Type.type(:package).provide :freebsd, :parent => :openbsd do > - desc "The specific form of package management on FreeBSD. This is an > - extremely quirky packaging system, in that it freely mixes between > - ports and packages. Apparently all of the tools are written in Ruby, > - so there are plans to rewrite this support to directly use those > - libraries." >-+ include Puppet::Util::Execution >++require 'open-uri' >++require 'net/ftp' >++require 'bz2' > > - commands :pkginfo => "/usr/sbin/pkg_info", > - :pkgadd => "/usr/sbin/pkg_add", > - :pkgdelete => "/usr/sbin/pkg_delete" >++Puppet::Type.type(:package).provide :freebsd, :parent => Puppet::Provider::Package do >++ include Puppet::Util::Execution >++ > + desc "The specific form of package management on FreeBSD. Resource names must be > + specified as the port origin: <port_category>/<port_name>." > + >@@ -24,84 +29,168 @@ index e10a20b..fbda52d 100755 > confine :operatingsystem => :freebsd > + defaultfor :operatingsystem => :freebsd > + >-+ def self.instances >-+ packages = [] >-+ >-+ output = pkginfo "-aoQ" >-+ output.split("\n").each do |data| >-+ lhs, pkg_origin = data.split(":") >-+ pkg_name = lhs.split("-").slice(0..-2).join("-") >-+ pkg_version = lhs.split("-")[-1] >-+ >-+ packages << new({ >-+ :provider => self.name, >-+ :name => pkg_origin, >-+ :ensure => pkg_version, >-+ }) >-+ end >++ @@lock = Mutex.new >++ @@ports_index = nil > > - def self.listcmd > - command(:pkginfo) >-+ packages >++ # fix bug in URI::FTP merge method that tries to set typecode >++ # even when other is a string. >++ class URI::FTP >++ def merge(other) >++ tmp = super(other) >++ if self != tmp >++ tmp.set_typecode(other.typecode) rescue NoMethodError >++ end >++ return tmp >++ end > end > >- def install >- should = @resource.should(:ensure) >+- def install >+- should = @resource.should(:ensure) >++ def self.parse_pkg_string(pkg_string) >++ { >++ :pkg_name => pkg_string.split("-").slice(0..-2).join("-"), >++ :pkg_version => pkg_string.split("-")[-1], >++ } >++ end >++ >++ def self.unparse_pkg_info(pkg_info) >++ [:pkg_name, :pkg_version].map { |key| pkg_info[key] }.join("-") >++ end > + >-+ origin = {} >-+ [:category, :name].zip(@resource[:name].split("/")).each { |a,b| origin[a] = b } >-+ Puppet.debug "origin => #{origin.inspect}" >-+ if origin[:name] == nil >-+ raise Puppet::Error.new "package name must be in origin format: <category>/<name>" >++ def self.parse_origin(origin_path) >++ begin >++ origin = { >++ :port_category => origin_path.split("/").fetch(-2), >++ :port_name => origin_path.split("/").fetch(-1), >++ } >++ rescue IndexError >++ raise Puppet::Error.new "#{origin_path}: not in required origin format: .*/<port_category>/<port_name>" > + end >-+ >-+ # source parameter is set >-+ if @resource[:source] >-+ source = URI.parse(@resource[:source]) >-+ Puppet.debug "source => #{source.inspect}" >++ origin >++ end > > - if @resource[:source] =~ /\/$/ > - if @resource[:source] =~ /^(ftp|https?):/ > - Puppet::Util::Execution::withenv :PACKAGESITE => @resource[:source] do > - pkgadd "-r", @resource[:name] >-+ # URI is for local file path. >-+ if (source.scheme == "file" || source.scheme == nil) && source.path >-+ # Pass pkg_add only the URI path. >-+ pkgadd source.path >++ def self.instances >++ packages = [] >++ output = pkginfo "-aoQ" >++ output.split("\n").each do |data| >++ pkg_string, pkg_origin = data.split(":") >++ pkg_info = self.parse_pkg_string(pkg_string) >++ >++ packages << new({ >++ :provider => self.name, >++ :name => pkg_origin, >++ :ensure => pkg_info[:pkg_version], >++ }) >++ end >++ packages >++ end > + >-+ # URI scheme is something other than 'file'. >-+ elsif source.scheme && source.host && source.path >-+ if source.path.end_with?(".tbz") # URI references a package. >-+ # Pass pkg_add the entire URI. >-+ pkgadd source.to_s >-+ else # Assume URI references a directory. >-+ # Set PACKAGESITE in execution environment to source URI. >-+ # Pass pkg_add the origin name. >-+ withenv :PACKAGESITE => source.path.end_with?("/") ? source.to_s : source.to_s << "/" do >-+ Puppet.debug "ENV['PACKAGESITE'] => #{ENV['PACKAGESITE']}" >-+ pkgadd "-rf", origin[:name] >++ def ports_index >++ @@lock.synchronize do >++ if @@ports_index.nil? >++ @@ports_index = {} >++ uri = source.merge "INDEX.bz2" >++ Puppet.debug "Fetching INDEX: #{uri.inspect}" >++ begin >++ open(uri, "r") do |f| >++ BZ2::Reader.open(f.path) do |f| >++ while (line = f.gets) >++ fields = line.split("|") >++ pkg_info = self.class.parse_pkg_string(fields[0]) >++ origin = self.class.parse_origin(fields[1]) >++ @@ports_index[origin] = pkg_info >++ end >++ end > + end >++ rescue IOError, OpenURI::HTTPError, Net::FTPError >++ @@ports_index = nil >++ raise Puppet::Error.new "Could not fetch ports INDEX: #{$!}" > end >-+ >-+ # URI is not usable by pkg_add >- else >+- else > - Puppet::Util::Execution::withenv :PKG_PATH => @resource[:source] do > - pkgadd @resource[:name] >-- end >-+ raise Puppet::Error.new "source URI is inappropriate: #{source.inspect}" >++ end >++ end >++ @@ports_index >++ end >++ >++ def uri_path >++ Facter.loadfacts >++ File.join( >++ "/", "pub", "FreeBSD", "ports", >++ Facter.value(:hardwareisa), >++ [ >++ "packages", >++ Facter.value(:kernelmajversion).split(".")[0], >++ "stable", >++ ].join("-") >++ ) << "/" >++ end >++ >++ def source >++ if !defined? @source >++ if @resource[:source] >++ @source = URI.parse(@resource[:source]) >++ if @source.path.empty? >++ @source.merge! uri_path >+ end >++ else # source parameter not set; build default source URI >++ @source = URI::FTP.build({ >++ :host => "ftp.freebsd.org", >++ :path => uri_path, >++ }) > end >++ Puppet.debug "Package: #{@resource[:name]}: source => #{@source.inspect}" >++ end >++ @source >++ end >++ >++ def origin >++ if !defined? @origin >++ @origin = self.class.parse_origin(@resource[:name]) >++ Puppet.debug "Package: #{@resource[:name]}: origin => #{@origin.inspect}" >++ end >++ @origin >++ end >++ >++ def package_uri >++ begin >++ pkg_name = self.class.unparse_pkg_info(ports_index.fetch(origin)) >++ rescue IndexError >++ raise Puppet::Error.new "package not found in INDEX" >++ end >++ uri = source.merge File.join("All", pkg_name + ".tbz") >++ Puppet.debug "Package: #{@resource[:name]}: package_uri => #{uri.inspect}" >++ uri >++ end >++ >++ def install >++ should = @resource.should(:ensure) >++ origin # call origin so we check the package name for correctness early > + >-+ # source parameter is not set. >++ # Source URI is for local file path. >++ if !source.absolute? or source.scheme == "file" >++ pkgadd source.path >++ # Source URI is to specific package file >++ elsif source.absolute? && source.path.end_with?(".tbz") >++ pkgadd source.to_s >++ # Source URI is to a package repository > else > - Puppet.warning "source is defined but does not have trailing slash, ignoring #{@resource[:source]}" if @resource[:source] > - pkgadd "-r", @resource[:name] >-+ # fetch package using default PACKAGESITE directory logic. >-+ # Pass pkg_add the origin name. >-+ pkgadd "-rf", origin[:name] >++ pkgadd "-f", package_uri.to_s > end >++ nil > end > >-@@ -44,7 +87,7 @@ Puppet::Type.type(:package).provide :freebsd, :parent => :openbsd do >+ def query >+@@ -44,7 +172,7 @@ Puppet::Type.type(:package).provide :freebsd, :parent => :openbsd do > end > > def uninstall >diff --git a/puppet/files/patch-fix_password_provider b/puppet/files/patch-fix_password_provider >new file mode 100644 >index 0000000..8fd0e20 >--- /dev/null >+++ b/puppet/files/patch-fix_password_provider >@@ -0,0 +1,42 @@ >+diff --git lib/puppet/provider/user/pw.rb lib/puppet/provider/user/pw.rb >+index a5988ca..c2fff37 100644 >+--- lib/puppet/provider/user/pw.rb >++++ lib/puppet/provider/user/pw.rb >+@@ -1,10 +1,11 @@ >+ require 'puppet/provider/nameservice/pw' >++require 'open3' >+ >+ Puppet::Type.type(:user).provide :pw, :parent => Puppet::Provider::NameService::PW do >+ desc "User management via `pw` on FreeBSD." >+ >+ commands :pw => "pw" >+- has_features :manages_homedir, :allows_duplicates >++ has_features :manages_homedir, :allows_duplicates, :manages_passwords >+ >+ defaultfor :operatingsystem => :freebsd >+ >+@@ -37,5 +38,24 @@ Puppet::Type.type(:user).provide :pw, :parent => Puppet::Provider::NameService:: >+ >+ cmd >+ end >++ >++ # use pw to update password hash >++ def password=(cryptopw) >++ Puppet.debug "change password for user '#{@resource[:name]}' method called with hash '#{cryptopw}'" >++ stdin, stdout, stderr = Open3.popen3("pw user mod #{@resource[:name]} -H 0") >++ stdin.puts(cryptopw) >++ stdin.close >++ Puppet.debug "finished password for user '#{@resource[:name]}' method called with hash '#{cryptopw}'" >++ end >++ >++ # get password from /etc/master.passwd >++ def password >++ Puppet.debug "checking password for user '#{@resource[:name]}' method called" >++ current_passline = `getent passwd #{@resource[:name]}` >++ current_password = current_passline.chomp.split(':')[1] if current_passline >++ Puppet.debug "finished password for user '#{@resource[:name]}' method called : '#{current_password}'" >++ current_password >++ end >++ >+ end >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 156239
: 114567