[puppet] Revert to minimal patch for augeas >= 0.10 (bz#771097)

Todd Zullinger tmz at fedoraproject.org
Thu Jan 5 14:09:30 UTC 2012


commit 04a1f392df961c396937fa6f935262354e54acc9
Author: Todd Zullinger <tmz at pobox.com>
Date:   Thu Jan 5 00:49:19 2012 -0500

    Revert to minimal patch for augeas >= 0.10 (bz#771097)
    
    After discussion in bugzilla, it's clear that a more minimal backport of
    changes to resolve issues with augeas >= 0.10 is the better approach.
    
    (That and I missed the patch which Dominic had helpfully attached to the
    bug when he initially filed it.)

 puppet-2.6.13-augeas-0.10.patch              |   60 ++++
 puppet-2.6.13-misc-augeas-improvements.patch |  490 --------------------------
 puppet.spec                                  |   12 +-
 3 files changed, 65 insertions(+), 497 deletions(-)
---
diff --git a/puppet-2.6.13-augeas-0.10.patch b/puppet-2.6.13-augeas-0.10.patch
new file mode 100644
index 0000000..2d2ee7c
--- /dev/null
+++ b/puppet-2.6.13-augeas-0.10.patch
@@ -0,0 +1,60 @@
+From e3fc5c4960de988b81e470d9e1f6a66c1bfd15e2 Mon Sep 17 00:00:00 2001
+From: Dominic Cleal <dcleal at redhat.com>
+Date: Mon, 19 Dec 2011 22:56:43 +0000
+Subject: [PATCH] (#11414) Test Augeas versions correctly with versioncmp
+
+The release of Augeas 0.10.0 broke simplistic version comparisons with the >=
+operator, so now use versioncmp.
+
+(Cherry pick of 735acad5 but without the accompanying test, which doesn't exist
+in 2.6.x).
+---
+ lib/puppet/provider/augeas/augeas.rb |    8 +++++---
+ 1 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb
+index 7dbd062..70406f6 100644
+--- a/lib/puppet/provider/augeas/augeas.rb
++++ b/lib/puppet/provider/augeas/augeas.rb
+@@ -19,9 +19,11 @@
+ 
+ require 'augeas' if Puppet.features.augeas?
+ require 'strscan'
++require 'puppet/util/package'
+ 
+ Puppet::Type.type(:augeas).provide(:augeas) do
+   include Puppet::Util
++  include Puppet::Util::Package
+ 
+   confine :true => Puppet.features.augeas?
+ 
+@@ -143,7 +145,7 @@ def open_augeas
+       debug("Opening augeas with root #{root}, lens path #{load_path}, flags #{flags}")
+       @aug = Augeas::open(root, load_path,flags)
+ 
+-      debug("Augeas version #{get_augeas_version} is installed") if get_augeas_version >= "0.3.6"
++      debug("Augeas version #{get_augeas_version} is installed") if versioncmp(get_augeas_version, "0.3.6") >= 0
+ 
+       if resource[:incl]
+         aug.set("/augeas/load/Xfm/lens", resource[:lens])
+@@ -279,7 +281,7 @@ def need_to_run?
+         # If we have a verison of augeas which is at least 0.3.6 then we
+         # can make the changes now, see if changes were made, and
+         # actually do the save.
+-        if return_value and get_augeas_version >= "0.3.6"
++        if return_value and versioncmp(get_augeas_version, "0.3.6") >= 0
+           debug("Will attempt to save and only run if files changed")
+           set_augeas_save_mode(SAVE_NOOP)
+           do_execute_changes
+@@ -303,7 +305,7 @@ def execute_changes
+     # Re-connect to augeas, and re-execute the changes
+     begin
+       open_augeas
+-      set_augeas_save_mode(SAVE_OVERWRITE) if get_augeas_version >= "0.3.6"
++      set_augeas_save_mode(SAVE_OVERWRITE) if versioncmp(get_augeas_version, "0.3.6") >= 0
+ 
+       do_execute_changes
+ 
+-- 
+1.7.5.4
+
diff --git a/puppet.spec b/puppet.spec
index 618d24c..46816eb 100644
--- a/puppet.spec
+++ b/puppet.spec
@@ -6,7 +6,7 @@
 
 Name:           puppet
 Version:        2.6.13
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        A network tool for managing many disparate systems
 License:        GPLv2
 URL:            http://puppetlabs.com
@@ -14,14 +14,9 @@ Source0:        http://downloads.puppetlabs.com/%{name}/%{name}-%{version}.tar.g
 Source1:        http://downloads.puppetlabs.com/%{name}/%{name}-%{version}.tar.gz.asc
 # https://projects.puppetlabs.com/issues/9167
 Patch0:         0001-9167-Do-not-sent-tagmail-reports-if-no-changes.patch
-# Various augeas improvements from 2.7.x, mostly needed to fix bz#771097
-# (upstream #11414)
-# http://projects.puppetlabs.com/issues/2728
-# http://projects.puppetlabs.com/issues/2744
-# http://projects.puppetlabs.com/issues/8808
 # http://projects.puppetlabs.com/issues/11414
 # https://bugzilla.redhat.com/771097
-Patch1:         puppet-2.6.13-misc-augeas-improvements.patch
+Patch1:         puppet-2.6.13-augeas-0.10.patch
 
 Group:          System Environment/Base
 
@@ -264,6 +259,9 @@ fi
 rm -rf %{buildroot}
 
 %changelog
+* Thu Jan 05 2012 Todd Zullinger <tmz at pobox.com> - 2.6.13-2
+- Revert to minimal patch for augeas >= 0.10 (bz#771097)
+
 * Wed Dec 14 2011 Todd Zullinger <tmz at pobox.com> - 2.6.13-1
 - Update to 2.6.13
 - Cherry-pick various augeas fixes from upstream (bz#771097)


More information about the scm-commits mailing list