How to use the cget.package.parse_pkg_build_tokens function in cget

To help you get started, we’ve selected a few cget examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pfultz2 / cget / cget / prefix.py View on Github external
def from_file(self, file, url=None, no_recipe=False):
        if file is not None and os.path.exists(file):
            start = os.path.dirname(file)
            if url is not None and url.startswith('file://'):
                start = url[7:]
            with open(file) as f:
                for line in f.readlines():
                    tokens = shlex.split(line, comments=True)
                    if len(tokens) > 0: 
                        yield self.parse_pkg_build(parse_pkg_build_tokens(tokens), start=start, no_recipe=no_recipe)