From 0e1a423889202ff61226540d353643be54b359c3 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Sun, 23 Jun 2019 17:05:18 +0200 Subject: [PATCH] Always clean files manually instead of using git I see a couple problems with using git to determine the files to delete: - git needs to be installed - The manual cleaning code is supposed to function correctly, so why not always use it? That way bugs in the manual cleaning code are also more likely to get discovered - If some files ignored by git should not be deleted, they need to be added to a sort of blacklist. If some files should be deleted by the manual cleanup code, they need to be added to a sort of whitelist. If someone forgets to add files to one of these lists, then not deleting files that should be deleted is better than deleting files that should not be deleted. --- setup.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/setup.py b/setup.py index 2249e3e55..31cb76015 100755 --- a/setup.py +++ b/setup.py @@ -780,17 +780,6 @@ Categories=System;TerminalEmulator; def clean(): os.chdir(os.path.dirname(os.path.abspath(__file__))) - if os.path.exists('.git'): - for f in subprocess.check_output( - 'git ls-files --others --ignored --exclude-from=.gitignore'.split() - ).decode('utf-8').splitlines(): - if f.startswith('logo/kitty.iconset') or f.startswith('dev/'): - continue - os.unlink(f) - if os.sep in f and not os.listdir(os.path.dirname(f)): - os.rmdir(os.path.dirname(f)) - return - # Not a git checkout, clean manually def safe_remove(*entries): for x in entries: