patch: scan-build/set-xcode-analyzer

The set-xcode-analyzer python script has a bug that prevents it from working with Xcode 5.x because the path returned from the call to xcode-select ends in a trailing / (and also a newline, if anyone cares). In any case, as a result, when line 103 attempts to trim off the /Developer portion of the path using os.path.dirname, it instead only trims off the last / and as a result the script is unable to modify the xcspec file under Xcode.app/Contents/PlugIns/.

There are multiple ways to fix this, but I thought that calling .rsplit on the right-most /Developer was the most direct way of implementing what the comment describes as the intended action.

From reading the site, my understanding is that mailing the attached svn diff output as a patch file is the best way to contribute fixes back. Let me know if there is anything else I can do.

Thanks!
Jeff Olson

set-xcode-analyzer.patch (535 Bytes)

Hi Jeff,

Thanks for the patch!

The set-xcode-analyzer python script has a bug that prevents it from working with Xcode 5.x because the path returned from the call to xcode-select ends in a trailing / (and also a newline, if anyone cares). In any case, as a result, when line 103 attempts to trim off the /Developer portion of the path using os.path.dirname, it instead only trims off the last / and as a result the script is unable to modify the xcspec file under Xcode.app/Contents/PlugIns/.

Interesting. I’m not seeing that behavior myself. For me xcode-select prints out a path that does not end in a trailing ‘/‘.

There are multiple ways to fix this, but I thought that calling .rsplit on the right-most /Developer was the most direct way of implementing what the comment describes as the intended action.

From reading the site, my understanding is that mailing the attached svn diff output as a patch file is the best way to contribute fixes back. Let me know if there is anything else I can do.

Thanks!
Jeff Olson

Your interpretation is correct. I’m wondering why there is a discrepancy between what you and I are seeing with the output of xcode-select, but the patch seems safe and does address the problem you are seeing.

Committed in r206752!

Whoops, missed the mailing list last night.