diff options
author | Andrew Wilcox <AWilcox@Wilcox-Tech.com> | 2016-07-13 02:09:56 -0500 |
---|---|---|
committer | Andrew Wilcox <AWilcox@Wilcox-Tech.com> | 2016-07-13 02:09:56 -0500 |
commit | db0be3d5d7f13a70fb9456bfd0a8481323ad7d2e (patch) | |
tree | bd903b9b27660ef809029e334ce1293659c5a11f | |
parent | bc50a338cc0d27aed255c454b24dd015603f108d (diff) | |
download | apkkit-db0be3d5d7f13a70fb9456bfd0a8481323ad7d2e.tar.gz apkkit-db0be3d5d7f13a70fb9456bfd0a8481323ad7d2e.tar.bz2 apkkit-db0be3d5d7f13a70fb9456bfd0a8481323ad7d2e.tar.xz apkkit-db0be3d5d7f13a70fb9456bfd0a8481323ad7d2e.zip |
APKFile: allow split packages to use * for files included
-rw-r--r-- | apkkit/io/apkfile.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/apkkit/io/apkfile.py b/apkkit/io/apkfile.py index 1257ac6..bc8d783 100644 --- a/apkkit/io/apkfile.py +++ b/apkkit/io/apkfile.py @@ -11,7 +11,8 @@ import sys import tarfile import yaml -from copy import copy +from copy import deepcopy +from fnmatch import fnmatch from functools import partial from itertools import chain from subprocess import Popen, PIPE @@ -94,7 +95,8 @@ def split_filter(split_info, tar_info): paths.add(component) if any([tar_info.name.startswith(path) for path in split_info['paths']]) or\ - any([tar_info.name == component for component in paths]): + any([tar_info.name == component for component in paths]) or\ + any([fnmatch(tar_info.name, path) for path in split_info['paths']]): return tar_info return None @@ -110,7 +112,8 @@ def base_filter(exclude_from_base, tar_info): The TarInfo object to inspect. """ - if any([tar_info.name.startswith(path) for path in exclude_from_base]): + if any([tar_info.name.startswith(path) for path in exclude_from_base]) or\ + any([fnmatch(tar_info.name, path) for path in exclude_from_base]): return None return tar_info @@ -366,7 +369,7 @@ class APKFile: ])) for split in splits: - split_package = copy(package) + split_package = deepcopy(package) split_package._pkgname = split['name'].format(name=package.name) if 'desc' in split: |