From ffd9fe2047d73e637e9e36a23b3f8c27d139fb3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Fri, 23 Sep 2005 13:30:35 +0000 Subject: [PATCH] - fix remove operation. file can be removed manually... --- pisi/operations.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pisi/operations.py b/pisi/operations.py index c5864d91..002a8b3d 100644 --- a/pisi/operations.py +++ b/pisi/operations.py @@ -41,9 +41,16 @@ def remove_single(package_name): # with a prefix and leaving the user to edit it. In the future # we'll have a plan for these configuration files. if fileinfo.type == ctx.const.conf: - os.rename(fpath, fpath + ".pisi") + if os.path.isfile(fpath): + os.rename(fpath, fpath + ".pisi") else: - os.unlink(fpath) + try: + os.unlink(fpath) + except OSError: + # file is removed (maybe manually) + # FIXME: should give a warning + pass + ctx.installdb.remove(package_name) packagedb.remove_package(package_name)