- fix remove operation.

file can be removed manually...
This commit is contained in:
Barış Metin
2005-09-23 13:30:35 +00:00
parent 189d6d661e
commit ffd9fe2047
+9 -2
View File
@@ -41,9 +41,16 @@ def remove_single(package_name):
# with a prefix and leaving the user to edit it. In the future # with a prefix and leaving the user to edit it. In the future
# we'll have a plan for these configuration files. # we'll have a plan for these configuration files.
if fileinfo.type == ctx.const.conf: if fileinfo.type == ctx.const.conf:
os.rename(fpath, fpath + ".pisi") if os.path.isfile(fpath):
os.rename(fpath, fpath + ".pisi")
else: 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) ctx.installdb.remove(package_name)
packagedb.remove_package(package_name) packagedb.remove_package(package_name)