From a99d67cdf234dab8c937d613c2b81a7f06b04869 Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Fri, 5 Dec 2014 13:32:47 +0200 Subject: main/augeas: update to 1.3.0 also fix the Shellvars lense to allow parsing of APKBUILD files --- ...llow-partial-quoting-mixing-multiple-styl.patch | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 main/augeas/0001-Shellvars-allow-partial-quoting-mixing-multiple-styl.patch (limited to 'main/augeas/0001-Shellvars-allow-partial-quoting-mixing-multiple-styl.patch') diff --git a/main/augeas/0001-Shellvars-allow-partial-quoting-mixing-multiple-styl.patch b/main/augeas/0001-Shellvars-allow-partial-quoting-mixing-multiple-styl.patch new file mode 100644 index 0000000000..b3d7012ae1 --- /dev/null +++ b/main/augeas/0001-Shellvars-allow-partial-quoting-mixing-multiple-styl.patch @@ -0,0 +1,68 @@ +From 937653cbb1f9681a575e0fa5e8f2d0e59fd9ab5c Mon Sep 17 00:00:00 2001 +From: Kaarle Ritvanen +Date: Thu, 4 Dec 2014 14:31:26 +0200 +Subject: [PATCH 1/5] Shellvars: allow partial quoting, mixing multiple styles + +--- + lenses/shellvars.aug | 8 ++++---- + lenses/tests/test_shellvars.aug | 4 ++++ + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug +index 073f69b..60091a9 100644 +--- a/lenses/shellvars.aug ++++ b/lenses/shellvars.aug +@@ -31,7 +31,7 @@ module Shellvars = + let xchgs = Build.xchgs + let semicol = del /;?/ "" + +- let char = /[^`;() '"\t\n]|\\\\"/ ++ let char = /[^`;() '"\t\n\\]|\\\\./ + let dquot = + let char = /[^"\\]|\\\\./ | Rx.cl + in "\"" . char* . "\"" (* " Emacs, relax *) +@@ -42,7 +42,7 @@ module Shellvars = + let dollar_assign = /\$\([^\(\)#\n]*\)/ + let dollar_arithm = /\$\(\([^\)#\n]*\)\)/ + +- let anyquot = (dquot|squot)+ | bquot | dbquot | dollar_assign | dollar_arithm ++ let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot + + let to_semicol_re = /[^#; \t\n][^#;\n]+[^#; \t\n]|[^#; \t\n]+/ + let sto_to_semicol = store to_semicol_re +@@ -57,7 +57,7 @@ module Shellvars = + (* arrays here because of typechecking headaches. Instead, they are *) + (* treated as a simple value *) + let array = +- let array_value = store (char+ | anyquot) in ++ let array_value = store anyquot in + del /\([ \t]*/ "(" . counter "values" . + [ seq "values" . array_value ] . + [ del /[ \t\n]+/ " " . seq "values" . array_value ] * +@@ -67,7 +67,7 @@ module Shellvars = + (* but fairly close. *) + let simple_value = + let empty_array = /\([ \t]*\)/ in +- store (char* | anyquot | empty_array) ++ store (anyquot | empty_array)? + + let export = [ key "export" . Util.del_ws_spc ] + let kv = Util.indent . export? . key key_re +diff --git a/lenses/tests/test_shellvars.aug b/lenses/tests/test_shellvars.aug +index 42fc2bd..e4fd79f 100644 +--- a/lenses/tests/test_shellvars.aug ++++ b/lenses/tests/test_shellvars.aug +@@ -399,6 +399,10 @@ esac\n" = + test Shellvars.lns get "FOO=``bar``\n" = + { "FOO" = "``bar``" } + ++ (* Partial quoting is allowed *) ++ test Shellvars.lns get "FOO=\"$bar\"/'baz'/$(quux)$((1 + 2))\n" = ++ { "FOO" = "\"$bar\"/'baz'/$(quux)$((1 + 2))" } ++ + (* unset can be used on wildcard variables *) + test Shellvars.lns get "unset ${!LC_*}\n" = + { "@unset" +-- +1.8.3.1 + -- cgit v1.2.3