if not options.short: for gimport in gimports: if options.showoccurrence: print "\t%s (%s)" % (gimport, ", ".join(package_imports_occurence[gimport])) else: print "\t%s" % gimport continue # Translate non-native class into package name (if -d option) if options.pkgdb: ip_obj = ImportPath(element) if not ip_obj.parse(): fmt_obj.printWarning("Unable to translate %s to package name" % element) continue pkg_name = ip_obj.getPackageName() if pkg_name == "": fmt_obj.printWarning(ip_obj.getError()) pkg_in_pkgdb = packageInPkgdb(pkg_name) if pkg_in_pkgdb: if options.verbose: print (GREEN + "Class: %s (%s) PkgDB=%s" + ENDC) % (element, pkg_name, pkg_in_pkgdb) else: print (RED + "Class: %s (%s) PkgDB=%s" + ENDC ) % (element, pkg_name, pkg_in_pkgdb) continue # Print class print "Class: %s" % element if not options.short: for gimport in sorted(gimports):
for element in sorted_classes: if element == "Native": continue if element == "Unknown": fmt_obj.printWarning("Some import paths were not detected. Please run gofed ggi -c on extracted tarball manually") continue if element.startswith(url): continue ip_obj = ImportPath(element) if not ip_obj.parse(): fmt_obj.printWarning("Unable to translate %s to package name" % element) continue pkg_name = ip_obj.getPackageName() pkg_in_pkgdb = False if pkg_name != "": pkg_in_pkgdb = packageInPkgdb(pkg_name) if pkg_in_pkgdb: print (GREEN + "Class: %s (%s) PkgDB=%s" + ENDC) % (element, pkg_name, pkg_in_pkgdb) else: print (RED + "Class: %s (%s) PkgDB=%s" + ENDC ) % (element, pkg_name, pkg_in_pkgdb) print "" fmt_obj.printInfo("Spec file %s at %s" % (specfile, os.getcwd()))