MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / getpackages

Function getpackages

tools/daca2-download.py:41–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39
40
41def getpackages():
42 if not wget('ls-lR.gz'):
43 return []
44 # TODO: handle exitcode?
45 subprocess.call(['nice', 'gunzip', 'ls-lR.gz'])
46 with open('ls-lR', 'rt') as f:
47 lines = f.readlines()
48 # TODO: handle exitcode?
49 subprocess.call(['rm', 'ls-lR'])
50
51 path = None
52 archives = []
53 filename = None
54 filenames = []
55 for line in lines:
56 line = line.strip()
57 if len(line) < 4:
58 if filename:
59 archives.append(path + '/' + latestvername(filenames))
60 path = None
61 filename = None
62 filenames = []
63 elif line[:12] == './pool/main/':
64 path = line[2:-1]
65 elif path and '.orig.tar.' in line:
66 filename = line[1 + line.rfind(' '):]
67 filenames.append(filename)
68
69 return archives
70
71
72def handleRemoveReadonly(func, path, exc):

Callers 1

daca2-download.pyFile · 0.70

Calls 2

wgetFunction · 0.70
latestvernameFunction · 0.70

Tested by

no test coverage detected