32 | 32 |
for line in p.stdout:
|
33 | 33 |
sys.stdout.write(decode_line(line))
|
34 | 34 |
sys.stdout.flush()
|
35 | |
p.wait()
|
36 | |
|
37 | |
|
38 | |
def traverse_directories(f, dirname):
|
39 | |
for filename in sorted(os.listdir(dirname)):
|
40 | |
fullname = os.path.join(dirname, filename)
|
41 | |
if os.path.islink(fullname):
|
42 | |
f.write(fullname + "\n")
|
43 | |
elif os.path.isdir(fullname):
|
44 | |
_traverse(fullname)
|
|
35 |
return p.wait()
|
|
36 |
|
|
37 |
|
|
38 |
def traverse_directories(f, basedir, dirname):
|
|
39 |
fulldirname = os.path.join(basedir, dirname)
|
|
40 |
for filename in sorted(os.listdir(fulldirname)):
|
|
41 |
subname = os.path.join(dirname, filename)
|
|
42 |
fullname = os.path.join(fulldirname, filename)
|
|
43 |
if os.path.isdir(fullname) and not os.path.islink(fullname):
|
|
44 |
traverse_directories(f, basedir, subname)
|
45 | 45 |
else:
|
46 | |
f.write(fullname + "\n")
|
|
46 |
f.write(subname + "\n")
|
47 | 47 |
|
48 | 48 |
|
49 | 49 |
def obtain_dirs_for_stream(router, stream_name):
|
|
155 | 155 |
if not os.path.isfile(manifest_filename):
|
156 | 156 |
print("Cannot read {}, creating it".format(manifest_filename))
|
157 | 157 |
with open(manifest_filename, "w") as f:
|
158 | |
traverse_directories(f, from_dir)
|
|
158 |
traverse_directories(f, from_dir, '')
|
159 | 159 |
|
160 | 160 |
print("Traversing manifest {}".format(manifest_filename))
|
161 | 161 |
|
|
163 | 163 |
for line in f:
|
164 | 164 |
path = line.strip()
|
165 | 165 |
|
166 | |
if not active and path == options.continue_from:
|
167 | |
print("Found {}, resuming verify".format(options.continue_from))
|
168 | |
active = True
|
|
166 |
from_path = os.path.join(from_dir, path)
|
|
167 |
to_path = os.path.join(to_dir, path)
|
|
168 |
|
|
169 |
assert not os.path.isdir(from_path)
|
|
170 |
|
169 | 171 |
if not active:
|
170 | |
continue
|
171 | |
if os.path.isdir(path):
|
172 | |
continue
|
173 | |
|
174 | |
# execute diff --brief --new-file "$F" "$TARGET$F"
|
175 | |
diffs = False
|
176 | |
if diffs:
|
177 | |
print("!!!", path)
|
178 | |
else:
|
179 | |
print(path)
|
|
172 |
if path == options.continue_from:
|
|
173 |
print("Found {}, resuming verify".format(options.continue_from))
|
|
174 |
active = True
|
|
175 |
else:
|
|
176 |
continue
|
|
177 |
|
|
178 |
exit_code = run_command(['diff', '--brief', '--new-file', from_path, to_path])
|
|
179 |
print("[OK]" if exit_code == 0 else "[!!]", path)
|
180 | 180 |
|
181 | 181 |
|
182 | 182 |
# - - - - driver - - - -
|