diff options
author | marha <marha@users.sourceforge.net> | 2011-12-23 15:22:05 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-12-23 15:22:05 +0100 |
commit | 52b728b4b397d26f8841848ee921950e083991d0 (patch) | |
tree | a2d300d32e942856c1f73612511c0e00a0f2cde5 | |
parent | 52b002a44dc240c8c24edb5418e11c49c0bb3e58 (diff) | |
download | vcxsrv-52b728b4b397d26f8841848ee921950e083991d0.tar.gz vcxsrv-52b728b4b397d26f8841848ee921950e083991d0.tar.bz2 vcxsrv-52b728b4b397d26f8841848ee921950e083991d0.zip |
Solved error in comparison script
-rw-r--r-- | filesthatshouldbethesame.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/filesthatshouldbethesame.py b/filesthatshouldbethesame.py index fa0367902..840bc1bce 100644 --- a/filesthatshouldbethesame.py +++ b/filesthatshouldbethesame.py @@ -1,5 +1,5 @@ from itertools import *
-import sys,os
+import sys,os,difflib
FilesStr=r"""
libX11\include\X11\cursorfont.h X11\cursorfont.h
@@ -8,7 +8,7 @@ libX11\include\X11\XKBlib.h X11\XKBlib.h libX11\include\X11\Xcms.h X11\Xcms.h
libX11\include\X11\Xregion.h X11\Xregion.h
libX11\include\X11\ImUtil.h X11\ImUtil.h
-libX11\include\X11\Xlib.h X11\Xlib.h
+libX11\include\X11\Xlib.h X11\Xlib.h
libX11\include\X11\Xresource.h X11\Xresource.h
libX11\include\X11\Xlib-xcb.h X11\Xlib-xcb.h
libX11\include\X11\Xutil.h X11\Xutil.h
@@ -194,20 +194,21 @@ def CompareFiles(f1name, f2name): try:
if len(sys.argv)>1:
print "Comparing",f1name,f2name
- f1 = open(f1name, 'U')
- f2 = open(f2name, 'U')
+ f1 = open(f1name, 'rU')
+ f2 = open(f2name, 'rU')
a = f1.readlines(); f1.close()
b = f2.readlines(); f2.close()
for line in difflib.ndiff(a, b):
if line[0]!=' ':
+ print f1name,"and",f2name,"are different"
return True
return False
except:
if not os.path.exists(f1name): print "\n",f1name,"does not exist\n"
if not os.path.exists(f2name): print "\n",f2name,"does not exist\n"
- return False
+ return True
for SrcFile,DestFile in izip(Files[0::2], Files[1::2]):
Diff |= CompareFiles(SrcFile, DestFile)
|