646: postreview script diff command options "-urNp" do not work on Solaris. gdiff required

threebre*********@gmai***** (Google Code) (Is this you? Claim this profile.)
July 26, 2009
What's the URL of the page containing the problem?
postrevew script

What steps will reproduce the problem?
1. Execute postreview on a Solaris system

The script will fail executing the diff command.

What is the expected output? What do you see instead?
Script does not work.

What operating system are you using? What browser?
Postreview -- command line.

Please provide any additional information below.

The diff command used in the postreview script to find the changes between
two versions of a file uses the command options "-urNp".  These options are
valid in GNU diff available on Linux, but not the diff command supplied by
default on Solaris.  Instead on Solaris gdiff should be used.

The following code change can work a round this problem:

ostype = execute ('uname -a')

if ostype == 'SunOS':
   diff_cmd = 'gdiff -urNp "%s" "%s"' % (old_file, new_file)
else:
    diff_cmd = 'diff -urNp "%s" "%s"' % (old_file, new_file)
#1 threebre*********@gmai***** (Google Code) (Is this you? Claim this profile.)
Slight modification required in my suggested code

ostype = execute ('uname -s').strip()

need to use -s parameter on uname, and strip the return char.

david
#2 david
Fixed in SVN r2060. Thanks!
  • +Fixed