-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcheckDependencies.py
66 lines (60 loc) · 2.18 KB
/
checkDependencies.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
##python3
import subprocess
def submit(command):
return subprocess.run(command, shell=True, check=True, stdout=subprocess.PIPE, universal_newlines=True)
def getDependecies (package):
process = submit("git grep %s"%package.replace("/",".")) ##works both for A/B and A.B
print("git grep %s"%package.replace("/","."))
modules = process.stdout.split("\n")
modules = modules[:-1]
return modules
packages = [
"DiffractiveForwardAnalysis/Configuration",
"DiffractiveForwardAnalysis/Skimming",
"ElectroWeakAnalysis/Configuration",
"ElectroWeakAnalysis/Skimming",
"ElectroWeakAnalysis/Utilities",
"ElectroWeakAnalysis/WENu",
"ElectroWeakAnalysis/WMuNu",
"ElectroWeakAnalysis/ZEE",
"ElectroWeakAnalysis/ZMuMu",
"QCDAnalysis/ChargedHadronSpectra",
"QCDAnalysis/Configuration",
"QCDAnalysis/Skimming",
"QCDAnalysis/UEAnalysis",
"HeavyFlavorAnalysis/Configuration",
"HeavyFlavorAnalysis/Skimming",
"HiggsAnalysis/HiggsToGammaGamma",
"HiggsAnalysis/Configuration",
"HiggsAnalysis/Skimming",
"TopQuarkAnalysis/Examples",
"TopQuarkAnalysis/TopPairBSM",
# "TopQuarkAnalysis/TopSkimming",
"SUSYBSMAnalysis/HSCP",
"MuonAnalysis/Configuration",
]
depsMap = {}
for package in packages:
depsMap[package] = getDependecies(package)
for dep in depsMap[package][:]:
for package2 in packages:
# print("Check %s == %s ?"%(dep[0:len(package)+1], package+"/"))
if dep[0:len(package2)+1]==(package2+"/") or dep[0:len("Utilities/ReleaseScripts/scripts/git-publish:")]=="Utilities/ReleaseScripts/scripts/git-publish:":
# print("removing %s"%dep)
if dep in depsMap[package]:
depsMap[package].remove(dep)
print("Unresolved dependencies:")
print()
print("######"+package+"######")
print()
for dep in depsMap[package]:
print(dep)
print("-----------------------------------------------------------------------")
print("Unresolved dependencies:")
for package in packages:
if len(depsMap[package])>0:
print()
print("######"+package+"######")
print()
for dep in depsMap[package]:
print(dep)