diff --git a/pisi/atomicoperations.py b/pisi/atomicoperations.py index 0232b9f4..6624d1f8 100644 --- a/pisi/atomicoperations.py +++ b/pisi/atomicoperations.py @@ -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: diff --git a/pisi/cli/remove.py b/pisi/cli/remove.py index fc90c9ae..266df6c5 100644 --- a/pisi/cli/remove.py +++ b/pisi/cli/remove.py @@ -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)