Example #1
0
def CmdPkgCheck(package, options):
  """Verify dependency information for given package(s)"""
  # The fact that we got this far means the pkg_info is basically valid.
  # This final check verifies the dependencies are valid.
  # Cache the list of all packages names since this function could be called
  # a lot in the case of "naclports check --all".
  packages = source_package.SourcePackageIterator()
  if not CmdPkgCheck.all_package_names:
    CmdPkgCheck.all_package_names = [os.path.basename(p.root) for p in packages]
  util.Log("Checking deps for %s .." % package.NAME)
  package.CheckDeps(CmdPkgCheck.all_package_names)
Example #2
0
def main(args):
    global options
    parser = optparse.OptionParser()
    parser.add_option('-v',
                      '--verbose',
                      action='store_true',
                      help='Output extra information.')
    options, _ = parser.parse_args(args)
    count = 0

    package_names = [
        os.path.basename(p.root) for p in naclports.package.PackageIterator()
    ]

    for package in naclports.package.PackageIterator():
        if not package.CheckDeps(package_names):
            return 1
        count += 1

    print "Verfied dependencies for %d packages" % count
    return 0