from sys import argv import os Information about package packageType i

  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
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
from sys import argv
import os
"""
Information about package:
packageType is type of build (av4srv, avcs, istp, private/fsfwtest...)
You may get it from list from svn file:///b:/svn/test/fsbuild/package
packageVersion and packageBuild is exactly the same as in about box or in folder name for incremental build
You can take debug versions of exe's and dll's using takeDebugVersions = 1.
You can delete old local files and dirs using deleteOldFilesAndDirs = 1.
You can take only symbols that contains strings from takeOnlyIt in path. For example
takeOnlyIt = [] - Will take all
takeOnlyIt = ["fsma", "aua"] - Will take only fsma and aua related pdb's
You may use directory list from svn: file:///b:/svn/test/fsbuild/module as filter
packageBuildType should be "incremental" in common case. But for private build if there is no incremental in the path you should use ""
How to use command line:
TakeSymbols.py packageType packageVersion packageBuild [packageBuildType]
Example: TakeSymbols.py istp "8.40" 1152
Examples:
#packageType = "istp"
#packageVersion = "8.40"
#packageBuild = "1152"
#packageBuildType = "incremental"
#packageType = "avcs"
#packageVersion = "8.00"
#packageBuild = "1239"
#packageBuildType = "incremental"
#packageType = "private/fsfwtest"
#packageVersion = "6.20"
#packageBuild = "270"
#packageBuildType = ""
"""
packageType = "istp"
packageVersion = "8.40"
packageBuild = "1152"
packageBuildType = "incremental"
takeDebugVersions = 0
deleteOldFilesAndDirs = 1
takeOnlyIt = []
def addToModules(line, modules):
spl = line.split('=')
if (len(spl) > 1) :
leftSpl = spl[0].split(' ')
if (len(leftSpl) > 1) :
#print("source = %s module=%s\n" % (leftSpl[-1], leftSpl[-2]))
if leftSpl[-1].find("source") != -1 and leftSpl[-2].find("<Module") != -1:
rightSpl = spl[1].split('\"')
#print("%s\n" % rightSpl)
if (len(rightSpl) > 2) :
modName = rightSpl[1]
needTake = 1
if (len(takeOnlyIt) > 0):
needTake = 0
for onl in takeOnlyIt:
if (modName.find(onl) != -1) :
needTake = 1
if needTake == 1 :
modules.append(modName)
return 0
if (deleteOldFilesAndDirs):
os.system("rd /S /Q fip")
os.system("rd /S /Q pdb")
os.system("rd /S /Q pdbs")
os.system("rd /S /Q debug")
os.system("rd /S /Q setuproot")
os.system("del /Q package.xml")
if(len(argv) > 3):
packageType = argv[1]
packageVersion = argv[2]
packageBuild = argv[3]
if(len(argv) > 4):
packageBuildType = argv[4]
packagePath = "file:///b:/svn/test/fsbuild/package/" + packageType + "/" + packageVersion + "/" + packageBuildType + "/build/" + packageBuild + "/package.xml"
print("Take package from %s" % packagePath)
os.system("svn export %s" % packagePath)
""" Find fileName in line from AV log """
modules = []
f = open("package.xml")
for line in f:
addToModules(line, modules)
f.close()
print("Modules list:");
print(modules);
for mod in modules:
pPath = "file:///b:/svn/test/fsbuild/" + mod + "/extra/pdbs/"
print("Take module info from %s" % pPath)
os.system("svn --force export %s" % pPath)
pPath = "file:///b:/svn/test/fsbuild/" + mod + "/extra/pdb/"
print("Take module info from %s" % pPath)
os.system("svn --force export %s" % pPath)
pPath = "file:///b:/svn/test/fsbuild/" + mod + "/fip/"
print("Take module info from %s" % pPath)
os.system("svn --force export %s" % pPath)
pPath = "file:///b:/svn/test/fsbuild/" + mod + "/setuproot/"
print("Take module info from %s" % pPath)
os.system("svn --force export %s" % pPath)
if (takeDebugVersions == 1) :
pPath = "file:///b:/svn/test/fsbuild/" + mod + "/extra/debug/"
print("Take module info from %s" % pPath)
os.system("svn --force export %s" % pPath)