From 57d26ac8e870f50c7112566fc4d4ab40713fb00a Mon Sep 17 00:00:00 2001 From: Jerry Date: Wed, 3 Apr 2019 21:02:24 +0800 Subject: [PATCH] repo.py: pathlib is pain in the ass --- repo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/repo.py b/repo.py index 63b8fde..afb092d 100755 --- a/repo.py +++ b/repo.py @@ -80,7 +80,8 @@ def repo_remove(fpaths): for fpath in fpaths: throw_away(fpath) sigpath = fpath.parent / f'{str(fpath.name)}.sig' - if sigpath.exists(): + # there is a fscking problem that fscking pathlib always follow symlinks + if sigpath.exists() or sigpath.is_symlink(): throw_away(sigpath) pkgnames = [get_pkg_details_from_name(fpath.name).pkgname for fpath in fpaths] return bash(f'{REPO_REMOVE_CMD} {dbpath} {" ".join(pkgnames)}', RUN_CMD_TIMEOUT=5*60)