summaryrefslogtreecommitdiff
path: root/rbtools/postreview.py
diff options
context:
space:
mode:
authortrowbrds <trowbrds@5efc13c4-1f27-0410-8691-ff2d1f55687e>2009-07-26 05:07:13 +0000
committertrowbrds <trowbrds@5efc13c4-1f27-0410-8691-ff2d1f55687e>2009-07-26 05:07:13 +0000
commit08f442039427b962142d48b821885cd6f7eec789 (patch)
treec46b97dea0d8622cb35f0040af79f970fe625479 /rbtools/postreview.py
parentf46825b93dc664d5497ba9d99f842686da3bb007 (diff)
Check for "SunOS" in post-review and use gdiff instead of diff
Solaris has BSD "diff" and GNU "gdiff". Since we use things which are only present in the GNU userland, we should account for that. This change checks for SunOS in the output of os.uname and uses gdiff if necessary.
Diffstat (limited to 'rbtools/postreview.py')
-rwxr-xr-xrbtools/postreview.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/rbtools/postreview.py b/rbtools/postreview.py
index 8fa8ce2..9f50f2c 100755
--- a/rbtools/postreview.py
+++ b/rbtools/postreview.py
@@ -1629,7 +1629,10 @@ class PerforceClient(SCMClient):
Returns a list of strings of diff lines.
"""
- diff_cmd = ["diff", "-urNp", old_file, new_file]
+ if os.uname and os.uname()[0] == 'SunOS':
+ diff_cmd = ["gdiff", "-urNp", old_file, new_file]
+ else:
+ diff_cmd = ["diff", "-urNp", old_file, new_file]
# Diff returns "1" if differences were found.
dl = execute(diff_cmd, extra_ignore_errors=(1,2),
translate_newlines=False)