diff options
author | 2011-08-25 19:20:42 +0000 | |
---|---|---|
committer | 2011-08-25 19:20:42 +0000 | |
commit | d4367ca0b5cdcccfb3d51b7868d15e1104b8b30c (patch) | |
tree | e40eed96a05c0291774ec5e324ffe921edf8218c | |
parent | docs changed: installing section (diff) | |
download | autodep-d4367ca0b5cdcccfb3d51b7868d15e1104b8b30c.tar.gz autodep-d4367ca0b5cdcccfb3d51b7868d15e1104b8b30c.tar.bz2 autodep-d4367ca0b5cdcccfb3d51b7868d15e1104b8b30c.zip |
allowing to access to rdepends of system packages
-rw-r--r-- | portage_with_autodep/pym/_emerge/EventsAnalyser.py | 23 | ||||
-rwxr-xr-x | src/autodep/autodep | 15 |
2 files changed, 32 insertions, 6 deletions
diff --git a/portage_with_autodep/pym/_emerge/EventsAnalyser.py b/portage_with_autodep/pym/_emerge/EventsAnalyser.py index f0aa7f8..2dc2d35 100644 --- a/portage_with_autodep/pym/_emerge/EventsAnalyser.py +++ b/portage_with_autodep/pym/_emerge/EventsAnalyser.py @@ -154,6 +154,7 @@ class PortageUtils: runtime_deps=runtime_deps.union(self.get_deps(dep,["RDEPEND"])) ret=buildtime_deps.union(runtime_deps) + return ret def get_system_packages_list(self): @@ -169,7 +170,19 @@ class PortageUtils: for pkg in self.vartree.dep_match(unvirt_pkg): ret.append(pkg) return ret - + + def get_system_packages_rdeps(self): + """ + returns runtime dependencies of packages from system set + + :returns: **list** of package names + """ + ret=set() + + for pkg in self.get_system_packages_list(): + ret=ret.union(self.get_deps(pkg,["RDEPEND"])) + return list(ret) + class GentoolkitUtils: """ @@ -266,13 +279,15 @@ class FilterProcGenerator: deps_portage=portageutils.get_dep('sys-apps/portage',["RDEPEND"]) system_packages=portageutils.get_system_packages_list() + system_deps=portageutils.get_system_packages_rdeps() allfiles=GentoolkitUtils().get_all_packages_files() portage.util.writemsg("All files list recieved, waiting for " \ "a list of allowed files\n") - allowedpkgs=system_packages+list(deps_portage)+list(deps_all) + allowedpkgs=system_packages+system_deps + allowedpkgs+=list(deps_portage)+list(deps_all) allowedpkgs+=["app-portage/autodep"] allowedfiles=GentoolkitUtils().getfilesbypackages(allowedpkgs) @@ -308,6 +323,7 @@ class EventsAnalyser: self.deps_portage=self.portageutils.get_dep('sys-apps/portage',["RDEPEND"]) self.system_packages=self.portageutils.get_system_packages_list() + self.system_deps=self.portageutils.get_system_packages_rdeps() # All analyse work is here # get unique filenames @@ -387,6 +403,7 @@ class EventsAnalyser: is_pkg_in_dep=package in self.deps_all is_pkg_in_portage_dep=package in self.deps_portage is_pkg_in_system=package in self.system_packages + is_pkg_in_system_dep=package in self.system_deps is_pkg_python="dev-lang/python" in package is_pkg_self="app-portage/autodep" in package @@ -427,6 +444,8 @@ class EventsAnalyser: portage.util.writemsg("[SYSTEM]") elif is_pkg_in_portage_dep: portage.util.writemsg("[PORTAGE DEP]") + elif is_pkg_in_system_dep: + portage.util.writemsg("[SYSTEM DEP]") elif is_pkg_self: portage.util.writemsg("[AUTODEP]") elif is_pkg_python: diff --git a/src/autodep/autodep b/src/autodep/autodep index 335cb2e..8d22e00 100755 --- a/src/autodep/autodep +++ b/src/autodep/autodep @@ -54,8 +54,9 @@ def parse_args(): def init_environment(): portage_api=portage_misc_functions.portage_api() system_packages = portage_api.get_system_packages_list() + system_deps = portage_api.get_system_packages_rdeps() - return portage_api, system_packages + return portage_api, system_packages, system_deps def init_runtime_vars(portage_api, options,args): runtime_vars={} # This is here mainly for grouping. We are trying to @@ -108,7 +109,7 @@ def init_runtime_vars(portage_api, options,args): return runtime_vars -def get_filter_function(options,args,system_packages,portage_api): +def get_filter_function(options,args,system_packages,system_deps,portage_api): # handling --block # exits if package name is bad if not options.packages and not options.strict_block: @@ -138,6 +139,8 @@ def get_filter_function(options,args,system_packages,portage_api): allfiles=portage_utils.get_all_packages_files() allowedpkgs=[] allowedpkgs+=system_packages + allowedpkgs+=system_deps + if runtime_vars["is_emerge"]: # blocking logic for emerge print "Notice: you can use emerge_strict command instead of autodep emerge." print "Using this command allows to build any number of a packages.\n" @@ -192,13 +195,13 @@ def get_filter_function(options,args,system_packages,portage_api): return True return filter -portage_api, system_packages=init_environment() +portage_api, system_packages, system_deps=init_environment() options,args=parse_args() runtime_vars=init_runtime_vars(portage_api,options,args) color_printer=colorize_output.color_printer(not options.nocolor) -filter_function=get_filter_function(options,args,system_packages,portage_api) +filter_function=get_filter_function(options,args,system_packages,system_deps,portage_api) # launching program events=logfs.fstracer.getfsevents(args[0], args,approach=options.approach,filterproc=filter_function) @@ -319,6 +322,8 @@ for package in sorted(packagesinfo): is_pkg_in_dep=package in runtime_vars["deps_all"] is_pkg_in_system=package in system_packages + is_pkg_in_system_deps=package in system_deps + is_pkg_in_portage_dep=runtime_vars["is_emerge"] and package in runtime_vars["deps_portage"] is_pkg_self="app-portage/autodep" in package is_pkg_python="dev-lang/python" in package @@ -358,6 +363,8 @@ for package in sorted(packagesinfo): color_printer.printmsg("text","[SYSTEM]") elif is_pkg_in_portage_dep: color_printer.printmsg("text","[PORTAGE DEP]") + elif is_pkg_in_system_deps: + color_printer.printmsg("text","[SYSTEM DEP]") elif is_pkg_self: color_printer.printmsg("text","[AUTODEP]") elif is_pkg_python: |