aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Bersenev <bay@hackerdom.ru>2011-08-21 15:59:46 +0000
committerAlexander Bersenev <bay@hackerdom.ru>2011-08-21 15:59:46 +0000
commit1626259059a7b2da817fe6a32126c2eddd14406c (patch)
tree9a18e84fcec9656cf11baf85abb7ce27f5d4f2ff /src
parentbig code commit in the last day before pencils down date (diff)
downloadautodep-1626259059a7b2da817fe6a32126c2eddd14406c.tar.gz
autodep-1626259059a7b2da817fe6a32126c2eddd14406c.tar.bz2
autodep-1626259059a7b2da817fe6a32126c2eddd14406c.zip
documentation changes and args parsing fixed
Diffstat (limited to 'src')
-rwxr-xr-xsrc/autodep/autodep20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/autodep/autodep b/src/autodep/autodep
index 034c47a..d607ed6 100755
--- a/src/autodep/autodep
+++ b/src/autodep/autodep
@@ -28,7 +28,7 @@ def parse_args():
args_parser.add_option("-v","--verbose", action="store_true", dest="verbose",
default=False, help="Show non-important packages, "
"unknown package and unknown stage")
- args_parser.add_option("-n","--numfiles",action="store", type="string",
+ args_parser.add_option("-n","--numfiles",action="store", type="int",
dest="numfiles",
default=10,
help="Maximum number of files from each package to show (default is 10)")
@@ -160,7 +160,7 @@ def get_filter_function(options,args,system_packages,portage_api):
depslist=list(portage_api.get_deps_for_package_building(pkg))
allowedpkgs+=depslist
# manually add all python interpreters to this list
- allowedpkgs+=["python"]
+ allowedpkgs+=["dev-lang/python"]
else:
program_path=runtime_vars["full_path"]
file_to_package=portage_utils.getpackagesbyfiles([program_path])
@@ -172,7 +172,7 @@ def get_filter_function(options,args,system_packages,portage_api):
portage_api.get_deps(file_to_package[program_path],["RDEPEND"]))
allowedpkgs+=depslist
- print allowedpkgs
+ #print allowedpkgs
# remember the allowedpkgs in deps_all. It is bad to do it here.
runtime_vars["deps_all"]=allowedpkgs
@@ -217,7 +217,17 @@ if runtime_vars["is_emerge"]:
portage_api.get_dep(pkg,["DEPEND"]))
runtime_vars["deps_portage"]=portage_api.get_dep('portage',["RDEPEND"])
-
+else:
+ if runtime_vars["deps_all"]==[]:
+ # we mostly repeating block logic here
+ program_path=runtime_vars["full_path"]
+ file_to_package=portage_utils.getpackagesbyfiles([program_path])
+ if program_path not in file_to_package:
+ print "Failed to find a package for %s" % program_path
+ else:
+ depslist=[file_to_package[program_path]]+list(
+ portage_api.get_deps(file_to_package[program_path],["RDEPEND"]))
+ runtime_vars["deps_all"]=depslist
#pkgs=portage_log_parser.get_list_of_merged_packages(
# runtime_vars["starttime"],runtime_vars["endtime"]
@@ -379,7 +389,7 @@ for package in sorted(packagesinfo):
if options.show_files:
continue
elif filescounter>options.numfiles:
- print " ... and %d more ...\n" % (len(filenames)-10)
+ print " ... and %d more ...\n" % (len(filenames)-options.numfiles)
break
# print not founded files with stages