From: <jh...@us...> - 2012-04-24 17:01:18
|
Revision: 317 http://etch.svn.sourceforge.net/etch/?rev=317&view=rev Author: jheiss Date: 2012-04-24 17:01:12 +0000 (Tue, 24 Apr 2012) Log Message: ----------- chdir back to / after processing individual files or commands. We chdir into the directory for the individual file/command before processing it so that the user can refer to other files in the same directory using relative paths. In practice it hasn't caused any problems to leave the server chdir'd into that directory until it processes the next file, but it does generate sporadic errors from the test suite when the directory disappears as the repository is updated. So to be on the safe and robust side we now chdir back to / after processing an individual file or command. Modified Paths: -------------- trunk/server/lib/etch.rb Modified: trunk/server/lib/etch.rb =================================================================== --- trunk/server/lib/etch.rb 2012-04-24 16:58:35 UTC (rev 316) +++ trunk/server/lib/etch.rb 2012-04-24 17:01:12 UTC (rev 317) @@ -822,6 +822,10 @@ end end + # Earlier we chdir'd into the file's directory in the repository. It + # seems best not to leave this process with that as the cwd. + Dir.chdir('/') + # In addition to successful configs return configs for files that need # orig data (generation_status==false) because any setup commands might be # needed to create the original file. @@ -961,6 +965,10 @@ generation_status = :success end + # Earlier we chdir'd into the command's directory in the repository. It + # seems best not to leave this process with that as the cwd. + Dir.chdir('/') + # If filtering didn't remove all the content then add this to the list of # commands to be returned to the client. if generation_status && generation_status != :unknown && This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |