[augeas-devel] insert comment before edited line?

Pat Riehecky riehecky at fnal.gov
Tue Dec 4 14:28:25 UTC 2012


Hello,

I'm trying to put a comment in right above a line before I change it.  
I'm going to be performing some edits on systems I do not administer.  
Leaving behind reasons why some things were changed should help explain 
things for the real administrators in the future.

In particular I've tried:

ins 99999 before /files/etc/httpd/conf/httpd.conf/*[arg =~ 
regexp('["]*/var/www/html["]*')]/*[arg = 'Indexes']
set /files/etc/httpd/conf/httpd.conf/99999 "# removed Indexes from Options"

but that does not seem to be right.

It feels like I'm close, but I couldn't tell you what I should be doing 
differently.

Any suggestions would be helpful......

print /augeas//error
/augeas/files/etc/httpd/conf/httpd.conf/error = "put_failed"
/augeas/files/etc/httpd/conf/httpd.conf/error/path = 
"/files/etc/httpd/conf/httpd.conf/Directory"
/augeas/files/etc/httpd/conf/httpd.conf/error/lens = 
"/usr/share/augeas/lenses/dist/httpd.aug:82.10-.63:"
/augeas/files/etc/httpd/conf/httpd.conf/error/message = "Failed to match 
\n    ({ /arg/ = /([^\\001-\\004\\t\\n 
\\\"'>]|\\\\\\\\\\\"|\\\\\\\\')+|\\\"([^\\001-\\004\\n\\\"\\\\]|\\\\\\\\[^\\001-\\004\\n])*\\\"|'([^\\001-\\004\\n'\\\\]|\\\\\\\\[^\\001-\\004\\n])*'/ 
}({ /arg/ = /([^\\001-\\004\\t\\n 
\\\"'>]|\\\\\\\\\\\"|\\\\\\\\')+|\\\"([^\\001-\\004\\n\\\"\\\\]|\\\\\\\\[^\\001-\\004\\n])*\\\"|'([^\\001-\\004\\n'\\\\]|\\\\\\\\[^\\001-\\004\\n])*'/ 
})*)?(<<rec>> | { /directive/ = /[A-Za-z][.0-9A-Z\\\\_a-z-]*/ } | { 
/#comment/ = /[^\\001-\\004\\t\\n ][^\\001-\\004\\n]*[^\\001-\\004\\t\\n 
]|[^\\001-\\004\\t\\n ]/ } | { })*\n  with tree\n    { \"arg\" = 
\"\"/var/www/html\"\" } {  } {  } { \"#comment\" = \"Possible values for 
the Options directive are \"None\", \"All\",\" } { \"#comment\" = \"or 
any combination of:\" } { \"#comment\" = \"Indexes Includes 
FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews\" } {  } { 
\"#comment\" = \"Note that \"MultiViews\" must be named *explicitly* --- 
\"Options All\"\" } { \"#comment\" = \"doesn't give it to you.\" } {  } 
{ \"#comment\" = \"The Options directive is both complicated and 
important.  Please see\" } { \"#comment\" = 
\"http://httpd.apache.org/docs/2.2/mod/core.html#options\" } { 
\"#comment\" = \"for more information.\" } {  } { \"99999\" } { 
\"directive\" = \"Options\" } {  } {  } { \"#comment\" = \"AllowOverride 
controls what directives may be placed in .htaccess files.\" } { 
\"#comment\" = \"It can be \"All\", \"None\", or any combination of the 
keywords:\" } { \"#comment\" = \"Options FileInfo AuthConfig Limit\" } 
{  } { \"directive\" = \"AllowOverride\" } {  } {  } { \"#comment\" = 
\"Controls who can get stuff from this server.\" } {  } { \"directive\" 
= \"Order\" } { \"directive\" = \"Allow\" } {  }"


Thanks,

Pat

-- 
Pat Riehecky




More information about the augeas-devel mailing list