From 2f91101954d1c4e603794e08e40a9944ea8830cd Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Mon, 26 Jan 2009 14:11:11 +0000 Subject: [PATCH] Add -x and --exclude-from packages to install operation. BUG:FIXED:9020 --- pisi/cli/install.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pisi/cli/install.py b/pisi/cli/install.py index 0d85737f..3f6dcc94 100644 --- a/pisi/cli/install.py +++ b/pisi/cli/install.py @@ -57,6 +57,11 @@ expanded to package names. default=None, help=_("Install component's and recursive components' packages")) group.add_option("-f", "--fetch-only", action="store_true", default=False, help=_("Fetch upgrades but do not install.")) + group.add_option("-x", "--exclude", action="append", + default=None, help=_("When installing packages, ignore packages and components whose basenames match pattern.")) + group.add_option("--exclude-from", action="store", + default=None, help=_("When installing packages, ignore packages and components whose basenames \ + match any pattern contained in file.")) self.parser.add_option_group(group) def run(self): @@ -78,4 +83,10 @@ expanded to package names. packages.extend(self.componentdb.get_union_packages(name, walk=True)) packages.extend(self.args) + if ctx.get_option('exclude_from'): + packages = pisi.blacklist.exclude_from(packages, ctx.get_option('exclude_from')) + + if ctx.get_option('exclude'): + packages = pisi.blacklist.exclude(packages, ctx.get_option('exclude')) + pisi.api.install(packages, ctx.get_option('reinstall'))