Skip to content

Commit fa88e96

Browse files
committed
Fixed bug in manifest/filesystem concordance validation
Missed case when both manifest and filesystem contain extra files Signed-off-by: Andrew Helwer <[email protected]>
1 parent 1f278ea commit fa88e96

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

.github/scripts/check_manifest_files.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,22 @@
7070
print('ERROR: .cfg file paths duplicated in manifest:\n' + '\n'.join(duplicate_cfg_paths))
7171

7272
# Check paths in manifest match paths on filesystem
73-
if tla_mf_paths < tla_fs_paths:
73+
if tla_mf_paths != tla_fs_paths:
7474
success = False
75-
print('ERROR: .tla files not recorded in manifest:\n' + '\n'.join(tla_fs_paths - tla_mf_paths))
76-
if tla_fs_paths < tla_mf_paths:
75+
only_in_manifest = tla_mf_paths - tla_fs_paths
76+
if any(only_in_manifest):
77+
print('ERROR: Manifest .tla files not found in specifications dir:\n' + '\n'.join(only_in_manifest))
78+
only_on_filesystem = tla_fs_paths - tla_mf_paths
79+
if any(only_on_filesystem):
80+
print('ERROR: .tla files not recorded in manifest:\n' + '\n'.join(only_on_filesystem))
81+
if cfg_mf_paths != cfg_fs_paths:
7782
success = False
78-
print('ERROR: Manifest .tla files not found in specifications dir:\n' + '\n'.join(tla_mf_paths - tla_fs_paths))
79-
if cfg_mf_paths < cfg_fs_paths:
80-
success = False
81-
print('ERROR: .cfg files not recorded in manifest:\n' + '\n'.join(cfg_fs_paths - cfg_mf_paths))
82-
if cfg_fs_paths < cfg_mf_paths:
83-
success = False
84-
print('ERROR: Manifest .cfg files not found in specifications dir:\n' + '\n'.join(cfg_mf_paths - cfg_fs_paths))
83+
only_in_manifest = cfg_mf_paths - cfg_fs_paths
84+
if any(only_in_manifest):
85+
print('ERROR: Manifest .cfg files not found in specifications dir:\n' + '\n'.join(only_in_manifest))
86+
only_on_filesystem = cfg_fs_paths - cfg_mf_paths
87+
if any(only_on_filesystem):
88+
print('ERROR: .cfg files not recorded in manifest:\n' + '\n'.join(only_on_filesystem))
8589

8690
if success:
8791
print('SUCCESS: manifest.json concords with files in repo')

0 commit comments

Comments
 (0)