def run_output(self, cmd, cwd=None, **kwargs): if cwd is None: cwd = self.builddir if True: print(" ".join(cmd)) os.makedirs(cwd, exist_ok=True) return common.run_output(cmd, cwd=cwd, **kwargs)
def _skip_link(target): global _skip_list if not _skip_list: output = common.run_output(['dpkg', '-L', 'libc6']).split() _skip_list = [i for i in output if 'lib' in i] return target in _skip_list
def run_output(self, cmd, cwd=None, **kwargs): if cwd is None: cwd = self.builddir if True: print(' '.join(cmd)) os.makedirs(cwd, exist_ok=True) return common.run_output(cmd, cwd=cwd, **kwargs)
def get_dependencies(elf): """Return a list of libraries that are needed to satisfy elf's runtime. This may include libraries contained within the project. """ logger.debug("Getting dependencies for {!r}".format(elf)) ldd_out = common.run_output(["ldd", elf]).split("\n") ldd_out = [l.split() for l in ldd_out] ldd_out = [l[2] for l in ldd_out if len(l) > 2 and os.path.exists(l[2])] # Now lets filter out what would be on the system system_libs = _get_system_libs() libs = [l for l in ldd_out if not os.path.basename(l) in system_libs] return libs
def get_dependencies(elf): """Return a list of libraries that are needed to satisfy elf's runtime. This may include libraries contained within the project. """ logger.debug('Getting dependencies for {!r}'.format(elf)) ldd_out = '' try: ldd_out = common.run_output(['ldd', elf]).split('\n') except subprocess.CalledProcessError: logger.warning( 'Unable to determine library dependencies for {!r}'.format(elf)) return [] ldd_out = [l.split() for l in ldd_out] ldd_out = [l[2] for l in ldd_out if len(l) > 2 and os.path.exists(l[2])] # Now lets filter out what would be on the system system_libs = _get_system_libs() libs = [l for l in ldd_out if not os.path.basename(l) in system_libs] return libs