All submissions to this site are governed by the Second Life Viewer Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.

Review Board 1.6.11

Welcome to the Second Life Viewer Code Review tool.
See the documentation on our wiki for how to use this site.

Do not fail when no scp command is found, unless it is actually needed to fetch something

Review Request #127 - Created Jan. 28, 2011 and submitted

Oz Linden Reviewers
viewer
None autobuild
During initialization, if there is no scp or pscp command found then autobuild fails immediately.  This is true whether or not any scp urls need to be used.

This change modifies the behavior so that a warning is printed if no command is found, but execution proceeds until an scp command is needed, at which time execution fails with an explanatory message.

This patch can print the warning multiple times - I didn't attempt to suppress the extras.
I've tested this locally, simulating the error by temporarily modifying the names of the commands to be found for scp.

I have not checked it on Windows, where the original problem was found.
Review request changed
Updated (Jan. 29, 2011, 5:01 a.m.)
removed the (possibly repeated) warnings about not finding an scp command
changed to using None properly rather than a fixed string value

(added logging that should have shown for doing scp copies, but --verbose does not seem to do anything.... different issue)
Posted (Jan. 29, 2011, 7:28 a.m.)
this is crashing devenv when you do autobuild build -c OpenSourceRelWithDebInfo  on a windows system
  1. When i tested this second dif was not a clean reop will retest again after deleating build tree
  2. tested new diff with fresh build tree and it dose work on windows 7.
Posted (Jan. 29, 2011, 1:23 p.m.)

   

  
autobuild/common.py (Diff revisions 1 - 2)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
The docstring of find_executable should probably indicate that ...
autobuild/common.py (Diff revisions 1 - 2)
 
 
... the return value is None when no matching executable can be found, as we (somewhat) rely on what the return value is in that case. (Not your fault, the old code already relied on that, too.)
autobuild/common.py (Diff revisions 1 - 2)
 
 
 
Usually one would test for None with
        if self._scp is None:
as testing for `not self._scp` will also trigger when the value is False (obviously) or (maybe less obvious) becomes False when casted to bool.

However, because we don't want self._scp to be an empty string when building the command below ...
autobuild/common.py (Diff revisions 1 - 2)
 
 
... testing for `not self._scp` here might actually be better, I'm not sure.