def patched(self, project_dir, spec, sack): """ Finds dependencies via makedepend - This is not garanteed to be all of them. Makedepend uses macro preprocessor and if it throws and error makedepend didn't print deps. """ out = Command([ "find " + path_to_str(project_dir) + " -name " + " -o -name ".join( ["'*." + ex + "'" for ex in self.EXT_CPP] ) ]).execute() cc_makedep = "" cc_included_files = [] for _f in out.splitlines(): try: cc_makedep = Command("makedepend -w 1000 " + str(_f) + " -f- 2>/dev/null").execute() except CalledProcessError as e: logging.warn(str(e.cmd) + "\n" + str(e.output)) continue cc_included_files += [ s for s in cc_makedep.split() if (s.startswith("/usr") or s.startswith("/include")) and str(project_dir) not in s] spec.required_files.update(cc_included_files) spec.build_required_files.update(cc_included_files)
def build_srpm(spec_file, tarball, output_dir): """ Builds source rpm from spec and tarball and moves it to the output directory """ Command("rpmdev-setuptree").execute() Command("cp " + path_to_str(tarball) + ' $(rpm --eval "%{_topdir}")/SOURCES').execute() output = Command("rpmbuild -bs " + path_to_str(spec_file)).execute() Command("mv " + path_to_str(output.split()[-1]) + " " + path_to_str(output_dir)).execute()
def build_srpm(spec_file, tarball, output_dir): """builds RPM package with build_srpm and build_rpm""" # Build srpm pakcage from given spec_file and tarball Command("rpmdev-setuptree").execute() Command("cp " + path_to_str(tarball) + ' $(rpm --eval "%{_topdir}")/SOURCES').execute() output = Command("rpmbuild -bs " + path_to_str(spec_file)).execute() Command("mv " + path_to_str(output.split()[-1]) + " " + path_to_str(output_dir)).execute()
def patched(self, project_dir, spec, sack): out = Command([ "find " + path_to_str(project_dir) + " -name " + " -o -name ".join(["'*." + ex + "'" for ex in self.EXT_CPP]) ]).execute() cc_makedep = "" cc_included_files = [] for _f in out.splitlines(): try: cc_makedep = Command("makedepend -w 1000 " + str(_f) + " -f- 2>/dev/null").execute() except CalledProcessError as e: logging.warn(str(e.cmd) + "\n" + str(e.output)) continue cc_included_files += [ s for s in cc_makedep.split() if (s.startswith("/usr") or s.startswith("/include")) and str(project_dir) not in s ] spec.required_files.update(cc_included_files) spec.build_required_files.update(cc_included_files)
def patched(self, project_dir, spec, sack): out = Command([ "find " + path_to_str(project_dir) + " -name " + " -o -name ".join( ["'*." + ex + "'" for ex in self.EXT_CPP] ) ]).execute() cc_makedep = "" cc_included_files = [] for _f in out.splitlines(): try: cc_makedep = Command("makedepend -w 1000 " + str(_f) + " -f- 2>/dev/null").execute() except CalledProcessError as e: logging.warn(str(e.cmd) + "\n" + str(e.output)) continue cc_included_files += [ s for s in cc_makedep.split() if (s.startswith("/usr") or s.startswith("/include")) and str(project_dir) not in s] spec.required_files.update(cc_included_files) spec.build_required_files.update(cc_included_files)
def patched(self, project_dir, spec, sack): """ Finds dependencies via makedepend - This is not garanteed to be all of them. Makedepend uses macro preprocessor and if it throws and error makedepend didn't print deps. """ out = Command([ "find " + path_to_str(project_dir) + " -name " + " -o -name ".join(["'*." + ex + "'" for ex in self.EXT_CPP]) ]).execute() cc_makedep = "" cc_included_files = [] for _f in out.splitlines(): try: cc_makedep = Command("makedepend -w 1000 " + str(_f) + " -f- 2>/dev/null").execute() except CalledProcessError as e: logging.warn(str(e.cmd) + "\n" + str(e.output)) continue cc_included_files += [ s for s in cc_makedep.split() if (s.startswith("/usr") or s.startswith("/include")) and str(project_dir) not in s ] spec.required_files.update(cc_included_files) spec.build_required_files.update(cc_included_files)