Server IP : 127.0.0.2 / Your IP : 18.220.192.109 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/augeas/lenses/dist/ |
Upload File : |
(* Variation of the Shellvars lens *) (* Supports only what's needed to handle sysconfig files *) (* Modified to strip quotes. In the put direction, add double quotes *) (* around values that need them *) (* To keep things simple, we also do not support shell variable arrays *) module Sysconfig = let eol = Shellvars.eol let semicol_eol = Shellvars.semicol_eol let key_re = Shellvars.key_re let eq = Util.del_str "=" let eol_for_comment = del /([ \t]*\n)([ \t]*(#[ \t]*)?\n)*/ "\n" let comment = Util.comment_generic_seteol /[ \t]*#[ \t]*/ "# " eol_for_comment let comment_or_eol = Shellvars.comment_or_eol let empty = Util.empty let bchar = /[^; \t\n"'\\]|\\\\./ (* " Emacs, relax *) let qchar = /["']/ (* " Emacs, relax *) (* We split the handling of right hand sides into a few cases: * bare - strings that contain no spaces, optionally enclosed in * single or double quotes * quot - strings that must be enclosed in single or double quotes * dquot - strings that contain at least one space or apostrophe, * which must be enclosed in double quotes * squot - strings that contain an unescaped double quote *) let bare = Quote.do_quote_opt (store bchar+) let quot = let word = bchar* . /[; \t]/ . bchar* in Quote.do_quote (store word+) let dquot = let char = /[^"\\]|\\\\./ in (* " *) let word = char* . "'" . char* in Quote.do_dquote (store word+) let squot = (* We do not allow escaped double quotes in single quoted strings, as *) (* that leads to a put ambiguity with bare, e.g. for the string '\"'. *) let char = /[^'\\]|\\\\[^"]/ in (* " *) let word = char* . "\"" . char* in Quote.do_squote (store word+) let kv (value:lens) = let export = Shellvars.export in let indent = Util.del_opt_ws "" in [ indent . export? . key key_re . eq . value . comment_or_eol ] let assign = let nothing = del /(""|'')?/ "" . value "" in kv nothing | kv bare | kv quot | kv dquot | kv squot let var_action = Shellvars.var_action let unset = [ var_action "unset" . comment_or_eol ] let bare_export = [ var_action "export" . comment_or_eol ] let source = [ Shellvars.source . comment_or_eol ] let lns = empty* . (comment | source | assign | unset | bare_export)* (* Examples: abc -> abc -> abc "abc" -> abc -> abc "a b" -> a b -> "a b" 'a"b' -> a"b -> 'a"b' *)