while(true) { string current_version = <sha1 of the dictionary table contents> if (!upgrade_scripts.containsKey(current_version)) { complain_loudly() exit(1) } else { string script = upgrade_scripts[current_version] if (script.empty()) break else execute(script) } }