X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/blobdiff_plain/51113adb98c4d82ab799ab38ea463427d0780daa..0d9974ba1c7a707352f9d50f592b39b095de534d:/keys/tripe-keys.in diff --git a/keys/tripe-keys.in b/keys/tripe-keys.in index 901e09b9..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') @@ -461,7 +471,7 @@ def cmd_update(args): OS.chdir(cwd) if OS.path.exists('repos'): OS.rename('repos', 'repos.old') OS.rename('tmp/repos', 'repos') - if not FC.cmp('tmp/tripe-keys.conf', 'tripe-keys.conf'): + if not FC.cmp('tmp/tripe-keys.conf', 'tripe-keys.conf', False): moan('configuration file changed: recommend running another update') OS.rename('tmp/tripe-keys.conf', 'tripe-keys.conf') rmtree('repos.old')