Add -x and --exclude-from packages to install operation.

BUG:FIXED:9020
This commit is contained in:
Faik Uygur
2009-01-26 14:11:11 +00:00
parent 5f06083730
commit 2f91101954
+11
View File
@@ -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'))