Skip to content

Commit 03501da

Browse files
authored
Merge pull request #19 from lumag/check-dsps
Check contents of directories with DSP files
2 parents e6425ee + 34d3bc9 commit 03501da

File tree

3 files changed

+44
-22
lines changed

3 files changed

+44
-22
lines changed
File renamed without changes.

qcs8300/Qualcomm/QCS8300-RIDE/gdsp0-DSP.AT.1.0.1-00096-LEMANS-1/gpdspr.jsn

Lines changed: 0 additions & 22 deletions
This file was deleted.

scripts/check.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,52 @@ def check_config(data, dirs):
123123
return ret
124124

125125
def list_git():
126+
if not os.path.exists(".git"):
127+
sys.stderr.write("Skipping git ls-files check, no .git dir")
128+
return None
129+
126130
git = os.popen("git ls-files")
127131
for file in git:
128132
yield file.rstrip("\n")
129133

130134
if git.close():
131135
sys.stderr.write("WHENCE: skipped contents validation, git file listing failed\n")
132136

137+
def check_dir(subdir):
138+
pattern_shell = re.compile("^fastrpc_shell(_unsigned)?_[0-9]$")
139+
# XXX: do we need to be that precise for map files?
140+
pattern_map1 = re.compile("^map_SHARED_LIBS_[a-z0-9]*\\.(a|c|gp)dsp[01]?\\.prodQ\\.txt$")
141+
pattern_map2 = re.compile("^map_AVS_SHARED_LIBS_[a-z0-9]*\\.adsp\\.prodQ\\.txt$")
142+
pattern_map3 = re.compile("^map_SLPI_SHARED_LIBS_[a-z0-9]*\\.slpi\\.prodQ\\.txt$")
143+
pattern_map4 = re.compile("^map_SSC_SLPI_USER_[a-z0-9]*\\.slpi\\.prodQ\\.txt$")
144+
pattern_map5 = re.compile("^map_SENSOR_IMG_[a-z0-9]*\\.adsp\\.prodQ_SHARED_LIBS\\.txt$")
145+
pattern_map6 = re.compile("^map_(AVS_)?SHARED_LIBS_AAAAAAAAQ\\.txt$")
146+
pattern_map7 = re.compile("^map_SSC_SLPI_USER_AAAAAAAAQ\\.txt$")
147+
pattern_library = re.compile("^[-_+0-9a-zA-Z]*\\.so(\\.[0-9]*)?$")
148+
149+
okay = True
150+
151+
for file in os.listdir(subdir):
152+
fullname = os.path.join(subdir, file)
153+
154+
if not os.path.isfile(fullname):
155+
sys.stderr.write("WHENCE: not a file %s\n" % fullname)
156+
okay = False
157+
158+
if not pattern_shell.match(file) and \
159+
not pattern_map1.match(file) and \
160+
not pattern_map2.match(file) and \
161+
not pattern_map3.match(file) and \
162+
not pattern_map4.match(file) and \
163+
not pattern_map5.match(file) and \
164+
not pattern_map6.match(file) and \
165+
not pattern_map7.match(file) and \
166+
not pattern_library.match(file):
167+
sys.stderr.write("WHENCE: unknown file type %s\n" % fullname)
168+
okay = False
169+
170+
return okay
171+
133172
def main():
134173
okay = True
135174
dirs = {}
@@ -173,6 +212,11 @@ def main():
173212
sys.stderr.write("%s\n" % e)
174213
okay = False
175214

215+
for entry in dirs.keys():
216+
if not check_dir(entry):
217+
sys.stderr.write("WHENCE: subdir %s failed the checks\n" % entry)
218+
okay = False
219+
176220
return 0 if okay else 1
177221

178222
if __name__ == "__main__":

0 commit comments

Comments
 (0)