From bf5f52d4a1d29158964aea626e7f7840adfb7d3e Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Thu, 25 Sep 2008 08:12:22 +0000 Subject: [PATCH] Seen on fontconfig package by Onur: pisi was leaving symlinks in the system when removing a package. --- pisi/atomicoperations.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pisi/atomicoperations.py b/pisi/atomicoperations.py index 64ae57a1..80df0a1c 100644 --- a/pisi/atomicoperations.py +++ b/pisi/atomicoperations.py @@ -509,8 +509,12 @@ class Remove(AtomicOperation): if fileinfo.type == ctx.const.conf: # config files are precious, leave them as they are # unless they are the same as provided by package. + # remove symlinks as they are, cause if the hash of the + # file it links has changed, it will be kept as is, + # and when the package is reinstalled the symlink will + # link to that changed file again. try: - if pisi.util.sha1_file(fpath) == fileinfo.hash: + if os.path.islink(fpath) or pisi.util.sha1_file(fpath) == fileinfo.hash: os.unlink(fpath) else: # keep changed file in history