diff --git a/SOURCES/augeas-1.1.0-kdump-new-options.patch b/SOURCES/augeas-1.1.0-kdump-new-options.patch new file mode 100644 index 0000000..d708875 --- /dev/null +++ b/SOURCES/augeas-1.1.0-kdump-new-options.patch @@ -0,0 +1,250 @@ +From 8cd29c1a058fff13f7da8ba8820642e7a44b57ca Mon Sep 17 00:00:00 2001 +From: Dominic Cleal +Date: Tue, 9 Sep 2014 09:12:28 +0100 +Subject: [PATCH] Kdump: parse new options, permit EOL comments, refactor + +Fixes RHBZ#1139298 + +(cherry picked from commit a8d43f617a8238107b71c498136800cb561b6246) + +Conflicts: + NEWS + +Test_Kdump: fix test of complete config file + +(cherry picked from commit 0951590aa50c37f0ea89f71e9509a7ccff587cd2) +--- + doc/naturaldocs/conf/lenses/Menu.txt | 1 + + lenses/kdump.aug | 64 +++++++++++++---------- + lenses/tests/test_kdump.aug | 99 ++++++++++++++++++++++++++++-------- + 3 files changed, 116 insertions(+), 48 deletions(-) + +diff --git a/doc/naturaldocs/conf/lenses/Menu.txt b/doc/naturaldocs/conf/lenses/Menu.txt +index 2a9af26..af0d421 100644 +--- a/doc/naturaldocs/conf/lenses/Menu.txt ++++ b/doc/naturaldocs/conf/lenses/Menu.txt +@@ -208,6 +208,7 @@ Group: Tests and Examples { + File: Test_JettyRealm (tests/test_jettyrealm.aug) + File: Test_JMXAccess (tests/test_jmxaccess.aug) + File: Test_JMXPassword (tests/test_jmxpassword.aug) ++ File: Test_Kdump (tests/test_kdump.aug) + File: Test_Keepalived (tests/test_keepalived.aug) + File: Test_Ldso (tests/test_ldso.aug) + File: Test_Lightdm (tests/test_lightdm.aug) +diff --git a/lenses/kdump.aug b/lenses/kdump.aug +index b8f4055..ddf50ed 100644 +--- a/lenses/kdump.aug ++++ b/lenses/kdump.aug +@@ -17,16 +17,36 @@ About: Configuration files + module Kdump = + autoload xfm + ++(************************************************************************ ++ * Group: USEFUL PRIMITIVES ++ *************************************************************************) ++ + let empty = Util.empty + let comment = Util.comment +-let value_to_eol = store Rx.space_in ++let value_to_eol = store /[^ \t\n#][^\n#]*[^ \t\n#]|[^ \t\n#]/ ++let int_to_eol = store Rx.integer + let delimiter = Util.del_ws_spc + let eol = Util.eol +-let value_to_spc = store Rx.no_spaces ++let value_to_spc = store Rx.neg1 + let key_to_space = key /[A-Za-z0-9_.\$-]+/ +-let eq = Util.del_str "=" ++let eq = Sep.equal ++ ++(************************************************************************ ++ * Group: ENTRY TYPES ++ *************************************************************************) ++ ++let list (kw:string) = counter kw ++ . Build.key_value_line_comment kw delimiter ++ (Build.opt_list [ seq kw . value_to_spc ] delimiter) ++ comment ++ ++let mdl_key_value = [ delimiter . key_to_space . ( eq . value_to_spc)? ] ++let mdl_options = [ key_to_space . mdl_key_value+ ] ++let mod_options = [ key "options" . delimiter . mdl_options . (comment|eol) ] + +-let simple_entry (kw:string) = [ key kw . delimiter . value_to_eol . eol ] ++(************************************************************************ ++ * Group: ENTRIES ++ *************************************************************************) + + (* Got from mount(8) *) + let fs_types = "adfs" | "affs" | "autofs" | "cifs" | "coda" | "coherent" +@@ -37,32 +57,20 @@ let fs_types = "adfs" | "affs" | "autofs" | "cifs" | "coda" | "coherent" + | "smbfs" | "sysv" | "tmpfs" | "ubifs" | "udf" | "ufs" | "umsdos" + | "usbfs" | "vfat" | "xenix" | "xfs" | "xiafs" + +-let fs = [ key fs_types . delimiter . value_to_eol . eol ] +- +-let bin = [ seq "bin" . delimiter . value_to_spc ] +-let extra_bins = [ key "extra_bins" . (bin)+ . eol ] +- +-let mdl = [ seq "module" . delimiter . value_to_spc ] +-let extra_modules = [ key "extra_modules" . (mdl)+ . eol ] ++let simple_kws = "raw" | "net" | "path" | "core_collector" | "kdump_post" ++ | "kdump_pre" | "default" | "ssh" | "sshkey" | "dracut_args" ++ | "fence_kdump_args" + ++let int_kws = "force_rebuild" | "override_resettable" | "debug_mem_level" ++ | "link_delay" | "disk_timeout" + +-let mdl_key_value = [ delimiter . key_to_space . ( eq . value_to_spc)? ] +-let mdl_options = [ key_to_space . mdl_key_value+ ] +-let mod_options = [ key "options" . delimiter . mdl_options . eol ] +- +- +-let option = simple_entry "raw" +- | simple_entry "net" +- | simple_entry "path" +- | simple_entry "disk_timeout" +- | simple_entry "core_collector" +- | simple_entry "link_delay" +- | simple_entry "kdump_post" +- | simple_entry "kdump_pre" +- | simple_entry "default" +- | fs +- | extra_bins +- | extra_modules ++let option = Build.key_value_line_comment ( simple_kws | fs_types ) ++ delimiter value_to_eol comment ++ | Build.key_value_line_comment int_kws delimiter int_to_eol comment ++ | list "extra_bins" ++ | list "extra_modules" ++ | list "blacklist" ++ | list "fence_kdump_nodes" + | mod_options + + (* View: lns +diff --git a/lenses/tests/test_kdump.aug b/lenses/tests/test_kdump.aug +index 7057782..51c79a3 100644 +--- a/lenses/tests/test_kdump.aug ++++ b/lenses/tests/test_kdump.aug +@@ -1,6 +1,9 @@ +-(* Test for kdump lens *) ++(* ++Module: Test_Kdump ++ Provides unit tests and examples for the lens. ++*) + +-module Test_kdump = ++module Test_Kdump = + + let conf = "# this is a comment + #another commented line +@@ -8,36 +11,92 @@ module Test_kdump = + #comment after empty line + # + #comment after empty comment +-path /var/crash ++path /var/crash #comment after entry + core_collector makedumpfile -c + default poweroff + raw /dev/sda5 + ext3 /dev/sda3 + net my.server.com:/export/tmp ++nfs my.server.com:/export/tmp + net user@my.server.com ++ssh user@my.server.com + link_delay 60 ++kdump_pre /var/crash/scripts/kdump-pre.sh + kdump_post /var/crash/scripts/kdump-post.sh + #extra_bins /usr/bin/lftp /a/b/c +-extra_bins /usr/bin/lftp /a/b/c ++extra_bins /usr/bin/lftp /a/b/c # comment + disk_timeout 30 + extra_modules gfs2 extra modules more + options babla labl kbak df=dfg + options babla labl kbak df=dfg +-options babla labl kbak df=dfg +-" +- +- let conf2 = "#comment +-kdump_post /var/crash/scripts/kdump-post.sh +-extra_modules gfs2 extra modules more ++options babla labl kbak df=dfg # comment ++sshkey /root/.ssh/kdump_id_rsa ++force_rebuild 1 ++override_resettable 1 ++dracut_args --omit-drivers \"cfg80211 snd\" --add-drivers \"ext2 ext3\" ++fence_kdump_args -p 7410 -f auto ++fence_kdump_nodes 192.168.1.10 10.34.63.155 ++debug_mem_level 3 ++blacklist gfs2 + " + +-(* test Kdump.lns get conf = ?*) +- test Kdump.lns get conf2 = +- { "#comment" = "comment" } +- { "kdump_post" = "/var/crash/scripts/kdump-post.sh" } +- { "extra_modules" +- { "1" = "gfs2" } +- { "2" = "extra" } +- { "3" = "modules" } +- { "4" = "more" } +- } ++ (* Test: Kdump.lns ++ Check whole config file *) ++ test Kdump.lns get conf = ++ { "#comment" = "this is a comment" } ++ { "#comment" = "another commented line" } ++ { } ++ { "#comment" = "comment after empty line" } ++ { } ++ { "#comment" = "comment after empty comment" } ++ { "path" = "/var/crash" ++ { "#comment" = "comment after entry" } } ++ { "core_collector" = "makedumpfile -c" } ++ { "default" = "poweroff" } ++ { "raw" = "/dev/sda5" } ++ { "ext3" = "/dev/sda3" } ++ { "net" = "my.server.com:/export/tmp" } ++ { "nfs" = "my.server.com:/export/tmp" } ++ { "net" = "user@my.server.com" } ++ { "ssh" = "user@my.server.com" } ++ { "link_delay" = "60" } ++ { "kdump_pre" = "/var/crash/scripts/kdump-pre.sh" } ++ { "kdump_post" = "/var/crash/scripts/kdump-post.sh" } ++ { "#comment" = "extra_bins /usr/bin/lftp /a/b/c" } ++ { "extra_bins" ++ { "1" = "/usr/bin/lftp" } ++ { "2" = "/a/b/c" } ++ { "#comment" = "comment" } } ++ { "disk_timeout" = "30" } ++ { "extra_modules" ++ { "1" = "gfs2" } ++ { "2" = "extra" } ++ { "3" = "modules" } ++ { "4" = "more" } } ++ { "options" ++ { "babla" ++ { "labl" } ++ { "kbak" } ++ { "df" = "dfg" } } } ++ { "options" ++ { "babla" ++ { "labl" } ++ { "kbak" } ++ { "df" = "dfg" } } } ++ { "options" ++ { "babla" ++ { "labl" } ++ { "kbak" } ++ { "df" = "dfg" } } ++ { "#comment" = "comment" } } ++ { "sshkey" = "/root/.ssh/kdump_id_rsa" } ++ { "force_rebuild" = "1" } ++ { "override_resettable" = "1" } ++ { "dracut_args" = "--omit-drivers \"cfg80211 snd\" --add-drivers \"ext2 ext3\"" } ++ { "fence_kdump_args" = "-p 7410 -f auto" } ++ { "fence_kdump_nodes" ++ { "1" = "192.168.1.10" } ++ { "2" = "10.34.63.155" } } ++ { "debug_mem_level" = "3" } ++ { "blacklist" ++ { "1" = "gfs2" } } diff --git a/SPECS/augeas.spec b/SPECS/augeas.spec index 5babf0e..8dc7fec 100644 --- a/SPECS/augeas.spec +++ b/SPECS/augeas.spec @@ -1,6 +1,6 @@ Name: augeas Version: 1.1.0 -Release: 12%{?dist} +Release: 12%{?dist}.1 Summary: A library for changing configuration files Group: System Environment/Libraries @@ -59,6 +59,9 @@ Patch16: augeas-1.1.0-keepalived-virtual-servers.patch # RHBZ#1066419: Krb5 module, parse braces in values Patch17: augeas-1.1.0-krb5-braces.patch +# RHBZ#1181280: Kdump module, new options and EOL comments +Patch18: augeas-1.1.0-kdump-new-options.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: readline-devel libselinux-devel libxml2-devel @@ -112,6 +115,7 @@ The libraries for %{name}. %patch15 -p1 %patch16 -p1 %patch17 -p1 +%patch18 -p1 %build %configure --disable-static @@ -172,6 +176,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/augeas.pc %changelog +* Tue Jan 13 2015 Dominic Cleal - 1.1.0-12.1 +- Kdump: parse new options, EOL comments (RHBZ#1181280) + * Tue Feb 25 2014 Dominic Cleal - 1.1.0-12 - Add patch for Dovecot, mailbox and quote support (RHBZ#1064387) - Add patch for Keepalived, virtual server fixes (RHBZ#1064388)