﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	notify_on_close	platform	project
2285	RFE: Add wildcard option in ExtraFiles portion of bundle_info.xml	Tristan Croll	Conrad Huang	"I'd like to suggest the following amendment to `get_extrafiles()` in `bundle_builder.py`:

{{{
    def _get_extrafiles(self, bi):
        import glob, os
        self.extrafiles = {}
        for dfs in self._get_elements(bi, ""ExtraFiles""):
            pkg_name = dfs.getAttribute(""package"")
            files = []
            for e in self._get_elements(dfs, ""ExtraFile""):
                source = e.getAttribute(""source"")
                filename = self._get_element_text(e)
                files.append((""file"", source, filename))
            for e in self._get_elements(dfs, ""ExtraFileGroup""):
                source = e.getAttribute(""source"")
                dirname = self._get_element_text(e)
                sourcefiles = glob.glob(source)
                if not len(sourcefiles):
                    raise RuntimeError('ExtraFileGroup pattern {} does not match any files!'.format(source))
                for sf in sourcefiles:
                    files.append((""file"", sf, os.path.join(dirname, os.path.basename(sf))))
            for e in self._get_elements(dfs, ""ExtraDir""):
                source = e.getAttribute(""source"")
                dirname = self._get_element_text(e)
                files.append((""dir"", source, dirname))
            if files:
                if not pkg_name:
                    pkg_name = self.package
                self.extrafiles[pkg_name] = files
                datafiles = [(t[0], t[2]) for t in files]
                try:
                    self.datafiles[pkg_name].extend(datafiles)
                except KeyError:
                    self.datafiles[pkg_name] = datafiles
}}}

... adding an extra field `ExtraFileGroup` that takes a wildcard expression as its `source` property and a destination directory as its contents. This makes it easy to handle compiled dependencies where the headers are intermingled with the implementation source - currently one would have to list each header file independently, or copy *all* the source. This way, that's reduced to e.g.:

{{{
     <ExtraFiles>
       <ExtraFileGroup source=""src/deps/clipper/*.h"">include/clipper</ExtraFileGroup>

     </ExtraFiles>
}}}"	enhancement	closed	major		Tool Shed		fixed						all	ChimeraX
