Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 857011 Details for
Bug 1033799
Augeas lens bug: shellvars and case statements with same-line ;; tokens
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
support for oneliners in case
case_noeol.patch (text/plain), 3.47 KB, created by
Filip Krska
on 2014-01-29 11:03:53 UTC
(
hide
)
Description:
support for oneliners in case
Filename:
MIME Type:
Creator:
Filip Krska
Created:
2014-01-29 11:03:53 UTC
Size:
3.47 KB
patch
obsolete
>diff -up augeas-1.0.0/lenses/shellvars.aug.case_noeol augeas-1.0.0/lenses/shellvars.aug >--- augeas-1.0.0/lenses/shellvars.aug.case_noeol 2014-01-29 11:41:08.095135936 +0100 >+++ augeas-1.0.0/lenses/shellvars.aug 2014-01-29 11:42:13.584156898 +0100 >@@ -62,6 +62,9 @@ module Shellvars = > let kv = [ Util.indent . export? . key key_re > . eq . (simple_value | array) . comment_or_eol ] > >+ let kv_noeol = [ Util.indent . export? . key key_re >+ . eq . (simple_value | array) ] >+ > let var_action (name:string) = > [ Util.indent . xchgs name ("@" . name) . Util.del_ws_spc > . store (key_re | matching_re) . comment_or_eol ] >@@ -69,11 +72,23 @@ module Shellvars = > let unset = var_action "unset" > let bare_export = var_action "export" > >+ let var_action_noeol (name:string) = >+ [ Util.indent . xchgs name ("@" . name) . Util.del_ws_spc >+ . store (key_re | matching_re) ] >+ >+ let unset_noeol = var_action_noeol "unset" >+ let bare_export_noeol = var_action_noeol "export" >+ > let source = > [ Util.indent > . del /\.|source/ "." . label ".source" > . Util.del_ws_spc . store /[^;=# \t\n]+/ . comment_or_eol ] > >+ let source_noeol = >+ [ Util.indent >+ . del /\.|source/ "." . label ".source" >+ . Util.del_ws_spc . store /[^;=# \t\n]+/ ] >+ > let shell_builtin_cmds = "ulimit" | "shift" | "exit" > > let builtin = >@@ -83,6 +98,12 @@ module Shellvars = > . [ label "args" . sto_to_semicol ])? > . comment_or_eol ] > >+ let builtin_noeol = >+ [ Util.indent . label "@builtin" >+ . store shell_builtin_cmds >+ . (Util.del_ws_spc >+ . [ label "args" . sto_to_semicol ])? ] >+ > let keyword (kw:string) = Util.indent . Util.del_str kw > let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl > >@@ -92,6 +113,11 @@ module Shellvars = > . ( Util.del_ws_spc . store Rx.integer )? > . comment_or_eol ] > >+ let return_noeol = >+ [ Util.indent . label "@return" >+ . Util.del_str "return" >+ . ( Util.del_ws_spc . store Rx.integer )? ] >+ > > (************************************************************************ > * Group: CONDITIONALS AND LOOPS >@@ -130,7 +156,8 @@ module Shellvars = > let case_entry = [ label "@case_entry" > . Util.indent . store /[^ \t\n\)]+/ > . Util.del_str ")" . eol >- . entry* >+ . entry* . (source_noeol | kv_noeol | unset_noeol >+ | bare_export_noeol | builtin_noeol | return_noeol)? > . Util.indent . Util.del_str ";;" . eol ] in > [ keyword_label "case" "@case" . Sep.space > . store (char+ | ("\"" . char+ . "\"")) >diff -up augeas-1.0.0/lenses/tests/test_shellvars.aug.case_noeol augeas-1.0.0/lenses/tests/test_shellvars.aug >--- augeas-1.0.0/lenses/tests/test_shellvars.aug.case_noeol 2014-01-29 11:26:28.070978507 +0100 >+++ augeas-1.0.0/lenses/tests/test_shellvars.aug 2014-01-29 11:26:44.822951147 +0100 >@@ -261,6 +261,20 @@ esac\n" = > { "@case_entry" = "*" > { "@unset" = "f" } } } > >+ (* Case oneliners *) >+ test lns get "case $f in >+ /tmp/file1) . /tmp/file1 ;; >+ /tmp/file2) . /tmp/file2 ;; >+ *) unset f;; >+esac\n" = >+ { "@case" = "$f" >+ { "@case_entry" = "/tmp/file1" >+ { ".source" = "/tmp/file1" } } >+ { "@case_entry" = "/tmp/file2" >+ { ".source" = "/tmp/file2" } } >+ { "@case_entry" = "*" >+ { "@unset" = "f" } } } >+ > (* Select *) > test lns get "select i in a b c; do . /tmp/file$i > done\n" =
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
Flags:
dcleal
: review+
Actions:
View
|
Diff
Attachments on
bug 1033799
: 857011