Skip to content

Commit de24e63

Browse files
libretroadminLibretroAdmin
authored andcommitted
tools/settings_migrate_group: refuse to overwrite an existing def file
Migrations now land from more than one workstation; a name chosen locally can collide with a def file that arrived upstream in the meantime, silently clobbering the other setting's single source. The target def name must be fresh.
1 parent 80fc771 commit de24e63

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tools/settings_migrate_group.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
def run(cmd): return subprocess.run(cmd, shell=True, capture_output=True, text=True)
3535
CSTR = r'"(?:[^"\\]|\\.)*"(?:\s*"(?:[^"\\]|\\.)*")*'
3636
TABLE, DEF, TITLE = sys.argv[1], sys.argv[2], sys.argv[3]
37+
assert not os.path.exists(os.path.join('settings', os.path.basename(DEF))), \
38+
'def file %s already exists upstream - pick a different name' % DEF
3739
SIGS = [('S_BOOL','f, T, n, d, sd, df, c'),
3840
('S_UINT','f, T, n, d, sd, df, c, mn, mx, st, ob, ok, rp'),
3941
('S_INT', 'f, T, n, d, sd, df, c, mn, mx, st, ob, ok, rp'),

0 commit comments

Comments
 (0)