@@ -52,15 +52,17 @@ def main(argv=[], prog_name=''):
52
52
description = 'Checks the version mismatches for dependencies '
53
53
'in Cargo based repositories' )
54
54
parser .add_argument ("-c" , "--compare" , action = 'store_true' ,
55
- help = 'Check for mismatches between 2 repositories ' )
55
+ help = 'Check for mismatches between parsec and parsec-tool. ' )
56
56
parser .add_argument ('--deps_dir' ,
57
57
required = True ,
58
58
nargs = '+' ,
59
- help = 'Existing directories that contain Cargo.toml for analyzing '
60
- 'dependencies' )
59
+ help = 'Existing directories that contain Cargo.toml for analyzing ' \
60
+ 'dependencies. Note: when using the -c option, parsec should be ' \
61
+ 'first of the listed directories and parsec-tool the second.' )
61
62
args = parser .parse_args ()
62
-
63
63
mismatches = dict ()
64
+
65
+ parsec_tool_flags = '--all-features -d'
64
66
parsec_flags = '--all-features' + ' '
65
67
parsec_flags += '--features tss-esapi/generate-bindings,cryptoki/generate-bindings -d'
66
68
@@ -71,7 +73,6 @@ def main(argv=[], prog_name=''):
71
73
'cexpr' : ['v0.6.0' ],
72
74
}
73
75
parsec_repo , parsec_tool_repo = args .deps_dir
74
- parsec_tool_flags = '--all-features -d'
75
76
mismatches_parsec = run_deps_mismatcher (run_cargo_tree (parsec_repo , parsec_flags ))
76
77
mismatches_parsec_tool = run_deps_mismatcher (run_cargo_tree (parsec_tool_repo ,
77
78
parsec_tool_flags )
@@ -85,17 +86,31 @@ def main(argv=[], prog_name=''):
85
86
if len (mistmatch ) > 0 :
86
87
mismatches [dep ] = mistmatch
87
88
else :
88
- # Versions should be sorted!
89
- exceptions = {
90
- 'base64' : ['v0.13.1' , 'v0.21.4' ],
91
- 'bindgen' : ['v0.57.0' , 'v0.66.1' ],
92
- 'bitflags' : ['v1.3.2' , 'v2.4.1' ],
93
- 'cexpr' : ['v0.4.0' , 'v0.6.0' ],
94
- 'nom' : ['v5.1.3' , 'v7.1.3' ],
95
- 'shlex' : ['v0.1.1' , 'v1.2.0' ],
96
- 'syn' : ['v1.0.109' , 'v2.0.38' ],
97
- }
98
- mismatches = run_deps_mismatcher (run_cargo_tree (args .deps_dir [0 ], parsec_flags ))
89
+ repo_dir = args .deps_dir [0 ]
90
+ if os .path .basename (repo_dir ) == 'parsec' :
91
+ # Versions should be sorted!
92
+ exceptions = {
93
+ 'base64' : ['v0.13.1' , 'v0.21.4' ],
94
+ 'bindgen' : ['v0.57.0' , 'v0.66.1' ],
95
+ 'bitflags' : ['v1.3.2' , 'v2.4.1' ],
96
+ 'cexpr' : ['v0.4.0' , 'v0.6.0' ],
97
+ 'nom' : ['v5.1.3' , 'v7.1.3' ],
98
+ 'shlex' : ['v0.1.1' , 'v1.2.0' ],
99
+ 'syn' : ['v1.0.109' , 'v2.0.38' ],
100
+ }
101
+ tree_flags = parsec_flags
102
+ elif os .path .basename (repo_dir ) == 'parsec-tool' :
103
+ # Versions should be sorted!
104
+ exceptions = {
105
+ 'base64' : ['v0.13.1' , 'v0.21.4' ],
106
+ 'bitflags' : ['v1.3.2' , 'v2.4.1' ],
107
+ 'nom' : ['v5.1.3' , 'v7.1.3' ],
108
+ 'syn' : ['v1.0.109' , 'v2.0.38' ],
109
+ 'yasna' : ['v0.4.0' , 'v0.5.2' ],
110
+ }
111
+ tree_flags = parsec_tool_flags
112
+
113
+ mismatches = run_deps_mismatcher (run_cargo_tree (repo_dir , tree_flags ))
99
114
mismatches = get_deps_with_more_than_1v (mismatches )
100
115
101
116
print ('---------------------exceptions-----------------------\n \n ' )
@@ -105,7 +120,8 @@ def main(argv=[], prog_name=''):
105
120
print_deps (mismatches )
106
121
107
122
if not args .compare :
108
- errormsg = "Found dependencies version mismatches in parsec"
123
+ repo_name = os .path .basename (args .deps_dir [0 ])
124
+ errormsg = "Found dependencies version mismatches in " + repo_name
109
125
else :
110
126
errormsg = "Found dependencies version mismatches between parsec and parsec-tool"
111
127
0 commit comments