X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/blobdiff_plain/f8fb566ec45fa2998ae4d9386ba6def92a4f4d35..838e5ce795980e172fa8567c205498e56ed89815:/keys/tripe-keys.in diff --git a/keys/tripe-keys.in b/keys/tripe-keys.in index db577b62..46e1816a 100644 --- a/keys/tripe-keys.in +++ b/keys/tripe-keys.in @@ -420,6 +420,16 @@ def cmd_upload(args): for base in commit: new = '%s.new' % base OS.rename(new, base) + + ## Remove files in the base-dir which don't correspond to ones we just + ## committed + allow = {} + basedir = conf['base-dir'] + bdl = len(basedir) + for base in commit: + if base.startswith(basedir): allow[base[bdl:]] = 1 + for found in OS.listdir(basedir): + if found not in allow: OS.remove(OS.path.join(basedir, found)) finally: OS.chdir(cwd) rmtree('tmp')