81 """a script to check the definitions of (reflex) plugins
82 across multiple so-called 'rootmap' files
87 print (
"::: chk-rflx :::")
90 import PyUtils.Dso
as Dso
93 'TMath' : (
'libCore.so',
'libMathCore.so'),
94 'string': (
'libGaudiKernelDict.so',
96 'liblcg_PyCoolDict.so',
98 '__pf__::CNV_71_9631': (
'libDataModelTestDataReadCnvPoolCnv.so',
99 'libDataModelTestDataWriteCnvPoolCnv.so',),
100 '__pf__::CNV_71_9632': (
'libDataModelTestDataReadCnvPoolCnv.so',
101 'libDataModelTestDataWriteCnvPoolCnv.so',),
102 '__pf__::CNV_71_9633': (
'libDataModelTestDataReadCnvPoolCnv.so',
103 'libDataModelTestDataWriteCnvPoolCnv.so',),
104 '__pf__::CNV_71_9634': (
'libDataModelTestDataReadCnvPoolCnv.so',
105 'libDataModelTestDataWriteCnvPoolCnv.so',),
106 '__pf__::CNV_71_9639': (
'libDataModelTestDataReadCnvPoolCnv.so',
107 'libDataModelTestDataWriteCnvPoolCnv.so',),
109 '__pf__::RootCollection': (
'liblcg_RootCollection.so',
110 'libAthAnalysisTools.so',),
116 def print_db( db, detailedDump = False ):
117 if detailedDump : fct =
lambda x: x
118 else: fct = os.path.basename
131 if args.capabilities:
132 libname = args.capabilities
134 capabilities = dsodb.capabilities(libname)
135 print (
"::: capabilities of [%s]" % (libname,))
136 print (os.linesep.join([
" %s"%c
for c
in capabilities]))
142 libname = args.chk_dups
144 print (
"::: checking duplicates for [%s]..." % (libname,))
145 dups = dsodb.duplicates(libname, pedantic=args.pedantic)
148 print (os.linesep.join([
" %s"%v
for v
in dups[k]]))
149 if len(dups.keys())>0:
155 if args.dump_content:
156 print (
"::: dumping content of all known plugins...")
157 entries = dsodb.content(pedantic=args.pedantic)
158 print_db(entries, args.detailed_dump)
159 print (
"::: known entries:",len(entries.keys()))
162 print (
"::: dumping all known libraries...")
163 libs = dsodb.libs(detailedDump=args.detailed_dump)
166 print (
"::: known libs:",len(libs))
169 print (
"::: dumping all known dso/rootmap files...")
170 dso_files = [dso
for dso
in dsodb.dsoFiles]
172 for dso_file
in dso_files:
173 if not args.detailed_dump:
174 dso_file = os.path.basename(dso_file)
175 print (
" -",dso_file)
176 print (
"::: known dsos:",len(dso_files))
178 if args.check_dict_dups:
179 print (
":: checking dict. duplicates...")
180 dups = dsodb.dictDuplicates(pedantic=args.pedantic)
185 if k
in _suppression_dct:
186 suppressed = [os.path.basename(ii)
in _suppression_dct[k]
189 suppression_log.append(k[:])
198 print_db(dups, args.detailed_dump)
199 if len(suppression_log):
201 print (
"## ignoring the following dups':")
202 for k
in suppression_log:
205 print (
"## all dups:",len(dups.keys()))
206 print (
"## dups:",len(dups.keys())-len(suppression_log))
208 if args.check_pf_dups:
209 print (
"::: checking (plugin factories) components dups...")
210 dups = dsodb.pfDuplicates(pedantic=args.pedantic)
215 if k
in _suppression_dct:
216 suppressed = [os.path.basename(ii)
in _suppression_dct[k]
219 suppression_log.append(k[:])
228 print_db(dups, args.detailed_dump)
229 if len(suppression_log):
231 print (
"## ignoring the following dups':")
232 for k
in suppression_log:
235 print (
"## all dups:",len(dups.keys()))
236 print (
"## dups:",len(dups.keys())-len(suppression_log))
238 if args.check_all_dups:
239 print (
"::: checking all components dups...")
240 dups = dsodb.pfDuplicates(pedantic=args.pedantic)
241 dups.update(dsodb.dictDuplicates(pedantic=args.pedantic))
247 if k
in _suppression_dct:
248 suppressed = [os.path.basename(ii)
in _suppression_dct[k]
251 suppression_log.append(k[:])
260 print_db(dups, args.detailed_dump)
261 if len(suppression_log):
263 print (
"## ignoring the following dups':")
264 for k
in suppression_log:
267 print (
"## all dups:",len(dups.keys()))
268 print (
"## dups:",len(dups.keys())-len(suppression_log))
271 print (
"::: ERROR !!")
273 print (
"::: All good.")