diff options
Diffstat (limited to 'src/autodep/package_utils/portage_misc_functions.py')
-rw-r--r-- | src/autodep/package_utils/portage_misc_functions.py | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/src/autodep/package_utils/portage_misc_functions.py b/src/autodep/package_utils/portage_misc_functions.py index 95c4ce4..aa95845 100644 --- a/src/autodep/package_utils/portage_misc_functions.py +++ b/src/autodep/package_utils/portage_misc_functions.py @@ -117,13 +117,25 @@ class portage_api: return ret # we found the best visible match in common tree + #import pdb; pdb.set_trace() metadata = dict(zip(self.metadata_keys, self.portdb.aux_get(pkg, self.metadata_keys))) dep_str = " ".join(metadata[k] for k in dep_type) + + # the IUSE default are very important for us + iuse_defaults=[ + u[1:] for u in metadata.get("IUSE",'').split() if u.startswith("+")] + + use=self.use.split() + + for u in iuse_defaults: + if u not in use: + use.append(u) + success, atoms = portage.dep_check(dep_str, None, self.settings, - myuse=self.use.split(), trees=portage.db, myroot=self.settings["ROOT"]) + myuse=use, trees=portage.db, myroot=self.settings["ROOT"]) if not success: return ret @@ -176,8 +188,18 @@ class portage_api: metadata = dict(zip(self.metadata_keys, self.vardb.aux_get(p, self.metadata_keys))) dep_str = " ".join(metadata[k] for k in dep_type) - - success, atoms = portage.dep_check(dep_str, None, self.settings, myuse=self.use.split(), + + # the IUSE default are very important for us + iuse_defaults=[ + u[1:] for u in metadata.get("IUSE",'').split() if u.startswith("+")] + + use=self.use.split() + + for u in iuse_defaults: + if u not in use: + use.append(u) + + success, atoms = portage.dep_check(dep_str, None, self.settings, myuse=use, trees=portage.db, myroot=self.settings["ROOT"]) if not success: @@ -195,6 +217,19 @@ class portage_api: unknown_packages.add(pkg) return ret + def get_deps_for_package_building(self, pkg): + """ + returns buildtime dependencies of current package and + all runtime dependencies of that buildtime dependencies + """ + buildtime_deps=self.get_dep(pkg, ["DEPEND"]) + runtime_deps=set() + for dep in buildtime_deps: + runtime_deps=runtime_deps.union(self.get_deps(dep,["RDEPEND"])) + + ret=buildtime_deps.union(runtime_deps) + return ret + def get_system_packages_list(self): """ returns all packages from system set. They are always implicit dependencies |