| |
@@ -15,6 +15,7 @@
|
| |
|
| |
import os
|
| |
from pprint import pformat
|
| |
+ from fnmatch import fnmatch
|
| |
import re
|
| |
import six
|
| |
|
| |
@@ -73,6 +74,9 @@
|
| |
for pkg in iterate_packages(package_sets, arch):
|
| |
if not pkg_is_rpm(pkg):
|
| |
continue
|
| |
+ if _is_filtered(pkg, filter_packages):
|
| |
+ log.write("%s if filtered\n" % pkg)
|
| |
+ continue
|
| |
for gathered_pkg, pkg_arch in packages:
|
| |
if isinstance(gathered_pkg, six.string_types) and not re.match(
|
| |
gathered_pkg.replace(".", "\\.")
|
| |
@@ -114,6 +118,9 @@
|
| |
for pkg in iterate_packages(package_sets, arch):
|
| |
if not pkg_is_debug(pkg):
|
| |
continue
|
| |
+ if _is_filtered(pkg, filter_packages):
|
| |
+ log.write("%s if filtered\n" % pkg)
|
| |
+ continue
|
| |
if pkg.sourcerpm not in seen_srpms:
|
| |
log.write("Not considering %s: corresponding srpm not included\n" % pkg)
|
| |
continue
|
| |
@@ -182,3 +189,15 @@
|
| |
for pkgset in package_sets:
|
| |
for pkg in pkgset[arch]:
|
| |
yield pkgset[arch][pkg]
|
| |
+
|
| |
+
|
| |
+ def _is_filtered(pkg, filters):
|
| |
+ """
|
| |
+ Check if pkg matches anything in the filter.
|
| |
+ """
|
| |
+ for filter_name, filter_arch in filters:
|
| |
+ if fnmatch(pkg.name, filter_name):
|
| |
+ if filter_arch is None or pkg.arch == filter_arch:
|
| |
+ return True
|
| |
+
|
| |
+ return False
|
| |