Add --purge to remove command

BUG:FIXES:5935
This commit is contained in:
Faik Uygur
2009-01-09 12:51:59 +00:00
parent 2836c59a2f
commit d359a9827b
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -521,6 +521,10 @@ class Remove(AtomicOperation):
else:
# keep changed file in history
historydb.save_config(package_name, fpath)
# after saving to history db, remove the config file any way
if ctx.get_option("purge"):
os.unlink(fpath)
except pisi.util.FileError:
pass
else:
+2
View File
@@ -42,6 +42,8 @@ expanded to package names.
def options(self):
group = optparse.OptionGroup(self.parser, _("remove options"))
super(Remove, self).options(group)
group.add_option("--purge", action="store_true",
default=False, help=_("Removes everything including changed config files of the package"))
group.add_option("-c", "--component", action="append",
default=None, help=_("Remove component's and recursive components' packages"))
self.parser.add_option_group(group)