Add --purge to remove command
BUG:FIXES:5935
This commit is contained in:
@@ -521,6 +521,10 @@ class Remove(AtomicOperation):
|
|||||||
else:
|
else:
|
||||||
# keep changed file in history
|
# keep changed file in history
|
||||||
historydb.save_config(package_name, fpath)
|
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:
|
except pisi.util.FileError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ expanded to package names.
|
|||||||
def options(self):
|
def options(self):
|
||||||
group = optparse.OptionGroup(self.parser, _("remove options"))
|
group = optparse.OptionGroup(self.parser, _("remove options"))
|
||||||
super(Remove, self).options(group)
|
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",
|
group.add_option("-c", "--component", action="append",
|
||||||
default=None, help=_("Remove component's and recursive components' packages"))
|
default=None, help=_("Remove component's and recursive components' packages"))
|
||||||
self.parser.add_option_group(group)
|
self.parser.add_option_group(group)
|
||||||
|
|||||||
Reference in New Issue
Block a user