-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmoduleCheck.py
More file actions
51 lines (39 loc) · 1.25 KB
/
Copy pathmoduleCheck.py
File metadata and controls
51 lines (39 loc) · 1.25 KB
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
import os
import glob
import sys
if len(sys.argv) < 2:
print "Not enough arguments"
print "Usage python moduleCheck.py [BUILDER]"
print "For example python moduleCheck.py BL03I-BUILDER"
quit()
if sys.argv[1] == "-h" or sys.argv[1] == 'h':
print "Script determine which modules are used in a builder module"
print "and which ones of those aren't released in rhel7"
print "Usage python migrate.py [BUILDER]"
print "For example python moduleCheck.py BL03I-BUILDER"
quit()
builder = sys.argv[1]
path = "/dls_sw/work/R3.14.12.3/support/"+builder+"/etc/makeIocs"
r7Work = "/dls_sw/prod/R3.14.12.7/support"
releaseFiles = list()
usedModules = list()
moduleToMigrate = list()
os.chdir(path)
for file in glob.glob("*_RELEASE"):
releaseFiles.append(file)
for file in releaseFiles:
f = open(file,"r")
for line in f:
if "$(SUPPORT)" in line or "$(WORK)" in line:
if line.split('/')[1] not in usedModules:
usedModules.append(line.split('/')[1])
usedModules.sort()
for module in usedModules:
if module not in os.listdir(r7Work):
moduleToMigrate.append(module)
print "Module used: "
for a in usedModules:
print a
print "\n\nModule to migrate: "
for a in moduleToMigrate:
print a