#!/usr/bin/env python3 import os import sys import re dir = sys.argv[1] if not os.path.exists(f'{dir}/PATCHED-hashtt'): raise Exception('not patched') for (subdir,dirnames,filenames) in os.walk(dir): for fn in filenames: if fn.endswith('.ml.hashtt-bak'): origfn = fn.removesuffix('.hashtt-bak') os.rename(f'{subdir}/{fn}',f'{subdir}/{origfn}') os.remove(f'{dir}/PATCHED-hashtt')