diff options
-rw-r--r-- | meta/classes/package.bbclass | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 5b1e902c07..b0f44c7faf 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
@@ -183,8 +183,13 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst | |||
183 | else: | 183 | else: |
184 | packages.append(pkg) | 184 | packages.append(pkg) |
185 | oldfiles = d.getVar('FILES_' + pkg, True) | 185 | oldfiles = d.getVar('FILES_' + pkg, True) |
186 | newfile = os.path.join(root, o) | ||
187 | # These names will be passed through glob() so if the filename actually | ||
188 | # contains * or ? (rare, but possible) we need to handle that specially | ||
189 | newfile = newfile.replace('*', '[*]') | ||
190 | newfile = newfile.replace('?', '[?]') | ||
186 | if not oldfiles: | 191 | if not oldfiles: |
187 | the_files = [os.path.join(root, o)] | 192 | the_files = [newfile] |
188 | if aux_files_pattern: | 193 | if aux_files_pattern: |
189 | if type(aux_files_pattern) is list: | 194 | if type(aux_files_pattern) is list: |
190 | for fp in aux_files_pattern: | 195 | for fp in aux_files_pattern: |
@@ -206,7 +211,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst | |||
206 | if postrm: | 211 | if postrm: |
207 | d.setVar('pkg_postrm_' + pkg, postrm) | 212 | d.setVar('pkg_postrm_' + pkg, postrm) |
208 | else: | 213 | else: |
209 | d.setVar('FILES_' + pkg, oldfiles + " " + os.path.join(root, o)) | 214 | d.setVar('FILES_' + pkg, oldfiles + " " + newfile) |
210 | if callable(hook): | 215 | if callable(hook): |
211 | hook(f, pkg, file_regex, output_pattern, m.group(1)) | 216 | hook(f, pkg, file_regex, output_pattern, m.group(1)) |
212 | 217 | ||
@@ -965,23 +970,28 @@ python populate_packages () { | |||
965 | msg = "FILES variable for package %s contains '//' which is invalid. Attempting to fix this but you should correct the metadata.\n" % pkg | 970 | msg = "FILES variable for package %s contains '//' which is invalid. Attempting to fix this but you should correct the metadata.\n" % pkg |
966 | package_qa_handle_error("files-invalid", msg, d) | 971 | package_qa_handle_error("files-invalid", msg, d) |
967 | filesvar.replace("//", "/") | 972 | filesvar.replace("//", "/") |
968 | files = filesvar.split() | 973 | |
969 | for file in files: | 974 | origfiles = filesvar.split() |
975 | files = [] | ||
976 | for file in origfiles: | ||
970 | if os.path.isabs(file): | 977 | if os.path.isabs(file): |
971 | file = '.' + file | 978 | file = '.' + file |
972 | if not file.startswith("./"): | 979 | if not file.startswith("./"): |
973 | file = './' + file | 980 | file = './' + file |
981 | globbed = glob.glob(file) | ||
982 | if globbed: | ||
983 | if [ file ] != globbed: | ||
984 | files += globbed | ||
985 | continue | ||
986 | files.append(file) | ||
987 | |||
988 | for file in files: | ||
974 | if not cpath.islink(file): | 989 | if not cpath.islink(file): |
975 | if cpath.isdir(file): | 990 | if cpath.isdir(file): |
976 | newfiles = [ os.path.join(file,x) for x in os.listdir(file) ] | 991 | newfiles = [ os.path.join(file,x) for x in os.listdir(file) ] |
977 | if newfiles: | 992 | if newfiles: |
978 | files += newfiles | 993 | files += newfiles |
979 | continue | 994 | continue |
980 | globbed = glob.glob(file) | ||
981 | if globbed: | ||
982 | if [ file ] != globbed: | ||
983 | files += globbed | ||
984 | continue | ||
985 | if (not cpath.islink(file)) and (not cpath.exists(file)): | 995 | if (not cpath.islink(file)) and (not cpath.exists(file)): |
986 | continue | 996 | continue |
987 | if file in seen: | 997 | if file in seen: |