[packages/chef] do not require plist when not using the feature

glen glen at pld-linux.org
Fri Dec 5 13:57:11 CET 2014


commit fce4f0b82a2850c85ac32263c838675e3bda7bec
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Dec 5 14:56:51 2014 +0200

    do not require plist when not using the feature

 chef.spec            |  3 +++
 optional-plist.patch | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)
---
diff --git a/chef.spec b/chef.spec
index 0309a24..a25770a 100644
--- a/chef.spec
+++ b/chef.spec
@@ -21,6 +21,7 @@ Patch1:		FHS.patch
 Patch2:		poldek.patch
 Patch3:		https://github.com/glensc/chef/compare/pld-knife-boostrap.patch
 # Patch3-md5:	8ff0fdfde6dc90018698775bf8f13062
+Patch4:		optional-plist.patch
 URL:		https://wiki.opscode.com/display/chef/
 BuildRequires:	rpm-rubyprov
 BuildRequires:	rpmbuild(macros) >= 1.673
@@ -70,6 +71,7 @@ Requires:	ruby-rubygems
 Requires:	ruby-yajl < 2
 Requires:	ruby-yajl >= 1.1
 Suggests:	chef-zero >= 2.0
+Suggests:	ruby-plist >= 3.1.0
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -111,6 +113,7 @@ gzip -d metadata
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
 
diff --git a/optional-plist.patch b/optional-plist.patch
new file mode 100644
index 0000000..cbaf5d8
--- /dev/null
+++ b/optional-plist.patch
@@ -0,0 +1,35 @@
+--- chef-11.14.6/lib/chef/provider/user/dscl.rb~	2014-12-05 12:56:20.000000000 +0200
++++ chef-11.14.6/lib/chef/provider/user/dscl.rb	2014-12-05 13:04:42.684470417 +0200
+@@ -19,7 +19,6 @@
+ require 'mixlib/shellout'
+ require 'chef/provider/user'
+ require 'openssl'
+-require 'plist'
+ 
+ class Chef
+   class Provider
+@@ -125,6 +124,8 @@
+ 
+               # Calling shell_out directly since we want to give an input stream
+               shadow_hash_xml = convert_binary_plist_to_xml(shadow_hash_binary.string)
++
++              require 'plist'
+               shadow_hash = Plist::parse_xml(shadow_hash_xml)
+ 
+               if shadow_hash["SALTED-SHA512"]
+@@ -558,6 +559,7 @@
+           begin
+             user_plist_file = "#{USER_PLIST_DIRECTORY}/#{@new_resource.username}.plist"
+             user_plist_info = run_plutil("convert xml1 -o - #{user_plist_file}")
++            require 'plist'
+             user_info = Plist::parse_xml(user_plist_info)
+           rescue Chef::Exceptions::PlistUtilCommandFailed
+           end
+@@ -571,6 +573,7 @@
+         #
+         def save_user_info(user_info)
+           user_plist_file = "#{USER_PLIST_DIRECTORY}/#{@new_resource.username}.plist"
++          require 'plist'
+           Plist::Emit.save_plist(user_info, user_plist_file)
+           run_plutil("convert binary1 #{user_plist_file}")
+         end
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/chef.git/commitdiff/fce4f0b82a2850c85ac32263c838675e3bda7bec



More information about the pld-cvs-commit mailing list