vfs_gpfs: Use full_path_tos instead of talloc_asprintf
[Samba.git] / script / compare_cc_results.py
blob17b43f08d432d5c84810500787c4862a3b6e60d7
1 #!/usr/bin/env python
4 # Compare the results of native and cross-compiled configure tests
7 from __future__ import print_function
8 import sys
9 import difflib
11 exceptions = [
12 'BUILD_DIRECTORY', 'SELFTEST_PREFIX', 'defines',
13 'CROSS_COMPILE', 'CROSS_ANSWERS', 'CROSS_EXECUTE',
14 'LIBSOCKET_WRAPPER_SO_PATH',
15 'LIBNSS_WRAPPER_SO_PATH',
16 'LIBPAM_WRAPPER_SO_PATH',
17 'LIBUID_WRAPPER_SO_PATH',
18 'LIBRESOLV_WRAPPER_SO_PATH',
21 base_lines = list()
22 base_fname = ''
24 found_diff = False
26 for fname in sys.argv[1:]:
27 lines = list()
28 f = open(fname, 'r')
29 for line in f:
30 if len(line.split('=', 1)) == 2:
31 key = line.split('=', 1)[0].strip()
32 if key in exceptions:
33 continue
34 lines.append(line)
35 f.close()
36 if base_fname:
37 diff = list(difflib.unified_diff(base_lines,lines,base_fname,fname))
38 if diff:
39 print('configuration files %s and %s do not match' % (base_fname, fname))
40 for l in diff:
41 sys.stdout.write(l)
42 found_diff = True
43 else:
44 base_fname = fname
45 base_lines = lines
47 if found_diff:
48 sys.exit(1)