diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2015-07-13 15:43:34 +0300 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2015-07-13 15:50:18 +0300 |
commit | ea3025c253dbfaf405eecd8f2388eda9be556e22 (patch) | |
tree | c4d369c46a8b0dcd991ab148ba14399fbb910f55 /main/augeas/0003-Shellvars-allow-partial-quoting-mixing-multiple-styl.patch | |
parent | 2da6699882bdacca2069bef0aa1cc4dd4da7f5b8 (diff) | |
download | aports-ea3025c253dbfaf405eecd8f2388eda9be556e22.tar.bz2 aports-ea3025c253dbfaf405eecd8f2388eda9be556e22.tar.xz |
main/augeas: align patch set with upstream
01-08: committed to upstream
09-11: GH #265
12: GH #119
13-14: dependency to 12
15: dependency to 09-12
Diffstat (limited to 'main/augeas/0003-Shellvars-allow-partial-quoting-mixing-multiple-styl.patch')
-rw-r--r-- | main/augeas/0003-Shellvars-allow-partial-quoting-mixing-multiple-styl.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/main/augeas/0003-Shellvars-allow-partial-quoting-mixing-multiple-styl.patch b/main/augeas/0003-Shellvars-allow-partial-quoting-mixing-multiple-styl.patch new file mode 100644 index 0000000000..483f1f6e27 --- /dev/null +++ b/main/augeas/0003-Shellvars-allow-partial-quoting-mixing-multiple-styl.patch @@ -0,0 +1,69 @@ +From a70c92f52136398ffbe6e5fd70effd3984e84a5f Mon Sep 17 00:00:00 2001 +From: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> +Date: Thu, 4 Dec 2014 14:31:26 +0200 +Subject: [PATCH 03/15] 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 b988972..d25e8ca 100644 +--- a/lenses/shellvars.aug ++++ b/lenses/shellvars.aug +@@ -34,7 +34,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 *) +@@ -45,7 +45,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 +@@ -60,7 +60,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 ] * +@@ -70,7 +70,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 a2d4f28..864cb6c 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" +-- +2.1.0 + |