diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2014-12-08 16:37:28 +0200 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2014-12-08 16:37:33 +0200 |
commit | 491d4e86baf9fcf4c526f827a70fc8d70b4fd899 (patch) | |
tree | 5b99e070bc1c370d59128f943ee8d58ec4b565c1 /main/augeas/0004-Shellvars-allow-wrapping-builtin-arguments-to-multip.patch | |
parent | 760934f05b012d865c323a7e4aaf593e3302b008 (diff) | |
download | aports-491d4e86baf9fcf4c526f827a70fc8d70b4fd899.tar.bz2 aports-491d4e86baf9fcf4c526f827a70fc8d70b4fd899.tar.xz |
main/augeas: more fixes to Shellvars lense
parse e.g. main/ruby/APKBUILD
Diffstat (limited to 'main/augeas/0004-Shellvars-allow-wrapping-builtin-arguments-to-multip.patch')
-rw-r--r-- | main/augeas/0004-Shellvars-allow-wrapping-builtin-arguments-to-multip.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/main/augeas/0004-Shellvars-allow-wrapping-builtin-arguments-to-multip.patch b/main/augeas/0004-Shellvars-allow-wrapping-builtin-arguments-to-multip.patch new file mode 100644 index 0000000000..ce5eff162f --- /dev/null +++ b/main/augeas/0004-Shellvars-allow-wrapping-builtin-arguments-to-multip.patch @@ -0,0 +1,45 @@ +From a2c84aed6a77bc93020ff38b97b8c436e9a5e903 Mon Sep 17 00:00:00 2001 +From: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> +Date: Thu, 4 Dec 2014 18:25:12 +0200 +Subject: [PATCH 04/10] Shellvars: allow wrapping builtin arguments to multiple + lines + +--- + lenses/shellvars.aug | 4 +--- + lenses/tests/test_shellvars.aug | 5 +++++ + 2 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug +index ae2ec90..e318328 100644 +--- a/lenses/shellvars.aug ++++ b/lenses/shellvars.aug +@@ -43,9 +43,7 @@ module Shellvars = + let dollar_arithm = /\$\(\([^\)#\n]*\)\)/ + + 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 ++ let sto_to_semicol = store (anyquot . (Rx.space . anyquot)*) + + let sto_to_semicol_quot = + let no_semicol_re = /[^"'#;\n]/ +diff --git a/lenses/tests/test_shellvars.aug b/lenses/tests/test_shellvars.aug +index a61bb29..90e529b 100644 +--- a/lenses/tests/test_shellvars.aug ++++ b/lenses/tests/test_shellvars.aug +@@ -165,6 +165,11 @@ unset ONBOOT # We do not want this var + { "@builtin" = "exit" } + { "@builtin" = "exit" { "args" = "2" } } + ++ (* Allow wrapping builtin arguments to multiple lines *) ++ test Shellvars.lns get "ulimit -c \\\nunlimited\nulimit \\\n -x 123\n" = ++ { "@builtin" = "ulimit" { "args" = "-c \\\nunlimited" } } ++ { "@builtin" = "ulimit" { "args" = "\\\n -x 123" } } ++ + (* Test semicolons *) + test lns get "VAR1=\"this;is;a;test\"\nVAR2=this;\n" = + { "VAR1" = "\"this;is;a;test\"" } +-- +1.8.3.1 + |