File 0001-Add-lens-to-parse-etc-default-star.patch of Package augeas.2416

From 9f43a7ed448b3284241f928880cf4b04cf0feb9e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cedric.bosdonnat@free.fr>
Date: Fri, 15 Apr 2016 15:28:20 +0200
Subject: [PATCH] Add lens to parse /etc/default/star

/etc/default/star is not really matching the shellvars expected syntax.
Create a lens for it based on man 1 star and exclude it from the
shellvars lens.
---
 doc/naturaldocs/conf/lenses/Menu.txt |  2 ++
 lenses/shellvars.aug                 |  1 +
 lenses/star.aug                      | 31 ++++++++++++++++++
 lenses/tests/test_star.aug           | 63 ++++++++++++++++++++++++++++++++++++
 tests/Makefile.am                    |  1 +
 6 files changed, 99 insertions(+)
 create mode 100644 lenses/star.aug
 create mode 100644 lenses/tests/test_star.aug

Index: augeas-1.2.0/doc/naturaldocs/conf/lenses/Menu.txt
===================================================================
--- augeas-1.2.0.orig/doc/naturaldocs/conf/lenses/Menu.txt
+++ augeas-1.2.0/doc/naturaldocs/conf/lenses/Menu.txt
@@ -157,6 +157,7 @@ Group: Specific Modules  {
    File: Ssh  (ssh.aug)
    File: Sshd  (sshd.aug)
    File: Sssd  (no auto-title, sssd.aug)
+   File: Star  (star.aug)
    File: Subversion  (subversion.aug)
    File: Sudoers  (sudoers.aug)
    File: Sysconfig_Route  (sysconfig_route.aug)
@@ -242,6 +243,7 @@ Group: Tests and Examples  {
    File: Test_Simplelines  (tests/test_simplelines.aug)
    File: Test_Simplevars  (tests/test_simplevars.aug)
    File: Test_SmbUsers  (tests/test_smbusers.aug)
+   File: Test_Star  (tests/test_star.aug)
    File: Test_Subversion  (tests/test_subversion.aug)
    File: Test_Sysconfig_Route  (tests/test_sysconfig_route.aug)
    File: Test_Sysctl  (tests/test_sysctl.aug)
Index: augeas-1.2.0/lenses/shellvars.aug
===================================================================
--- augeas-1.2.0.orig/lenses/shellvars.aug
+++ augeas-1.2.0/lenses/shellvars.aug
@@ -205,6 +205,7 @@ module Shellvars =
   let filter_default = incl "/etc/default/*"
                      . excl "/etc/default/grub_installdevice*"
                      . excl "/etc/default/rmt"
+                     . excl "/etc/default/star"
                      . excl "/etc/default/whoopsie"
   let filter_misc    = incl "/etc/arno-iptables-firewall/debconf.cfg"
                      . incl "/etc/cron-apt/config"
Index: augeas-1.2.0/lenses/star.aug
===================================================================
--- /dev/null
+++ augeas-1.2.0/lenses/star.aug
@@ -0,0 +1,31 @@
+(*
+Module: Star
+  Parses star's configuration file
+
+Author: Cedric Bosdonnat <cbosdonnat@suse.com>
+
+About: Reference
+    This lens is based on star(1)
+
+About: License
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
+*)
+
+module Star =
+  autoload xfm
+
+let sto_to_tab = store Rx.no_spaces
+
+let size  = Build.key_value_line "STAR_FIFOSIZE" Sep.space_equal ( store /[0-9x*.a-z]+/ )
+let size_max   = Build.key_value_line "STAR_FIFOSIZE_MAX" Sep.space_equal ( store /[0-9x*.a-z]+/ )
+let archive = Build.key_value_line ( "archive". /[0-7]/ ) Sep.equal
+               ( [ label "device" . sto_to_tab ] . Sep.tab .
+                 [ label "block" . sto_to_tab ] . Sep.tab .
+                 [ label "size" . sto_to_tab ] . ( Sep.tab .
+                 [ label "istape" . sto_to_tab ] )? )
+
+let lns = ( size | size_max | archive | Util.comment | Util.empty )*
+
+let filter = incl "/etc/default/star"
+
+let xfm = transform lns filter
Index: augeas-1.2.0/lenses/tests/test_star.aug
===================================================================
--- /dev/null
+++ augeas-1.2.0/lenses/tests/test_star.aug
@@ -0,0 +1,63 @@
+module Test_star =
+
+let conf = "# @(#)star.dfl  1.2 05/08/09 Copyright 2003 J. Schilling
+#
+# This file is /etc/default/star
+
+STAR_FIFOSIZE=         32m
+
+STAR_FIFOSIZE_MAX=     100m
+
+archive0=/dev/rmt/0             20      0   N
+archive1=/dev/rmt/0n            20      0   n
+archive2=/dev/rmt/1             20      0   y
+archive3=/dev/rmt/1n            20      0
+archive4=/dev/rmt/0             126     0
+archive5=/dev/rmt/0n            126     0
+archive6=/dev/rmt/1             126     0
+archive7=/dev/rmt/1n            126     0
+"
+test Star.lns get conf =
+  { "#comment" = "@(#)star.dfl  1.2 05/08/09 Copyright 2003 J. Schilling" }
+  { }
+  { "#comment" = "This file is /etc/default/star" }
+  { }
+  { "STAR_FIFOSIZE" = "32m" }
+  { }
+  { "STAR_FIFOSIZE_MAX" = "100m" }
+  { }
+  { "archive0"
+    { "device" = "/dev/rmt/0" }
+    { "block" = "20" }
+    { "size" = "0" }
+    { "istape" = "N" } }
+  { "archive1"
+    { "device" = "/dev/rmt/0n" }
+    { "block" = "20" }
+    { "size" = "0" }
+    { "istape" = "n" } }
+  { "archive2"
+    { "device" = "/dev/rmt/1" }
+    { "block" = "20" }
+    { "size" = "0" }
+    { "istape" = "y" } }
+  { "archive3"
+    { "device" = "/dev/rmt/1n" }
+    { "block" = "20" }
+    { "size" = "0" } }
+  { "archive4"
+    { "device" = "/dev/rmt/0" }
+    { "block" = "126" }
+    { "size" = "0" } }
+  { "archive5"
+    { "device" = "/dev/rmt/0n" }
+    { "block" = "126" }
+    { "size" = "0" } }
+  { "archive6"
+    { "device" = "/dev/rmt/1" }
+    { "block" = "126" }
+    { "size" = "0" } }
+  { "archive7"
+    { "device" = "/dev/rmt/1n" }
+    { "block" = "126" }
+    { "size" = "0" } }
Index: augeas-1.2.0/tests/Makefile.am
===================================================================
--- augeas-1.2.0.orig/tests/Makefile.am
+++ augeas-1.2.0/tests/Makefile.am
@@ -174,6 +174,7 @@ lens_tests =			\
   lens-ssh.sh			\
   lens-sshd.sh			\
   lens-sssd.sh			\
+  lens-star.sh          \
   lens-stunnel.sh			\
   lens-subversion.sh		\
   lens-sysconfig.sh		\
openSUSE Build Service is sponsored by