示例#1
0
def AddPackageDep(dep_dict, dep):
    dep_dict['origin'] = dep

    if os.path.isdir(dep):
        dep_dict['version'] = package.Package(
            info_file=os.path.join(dep, 'pkg_info')).VERSION
        return

    for subdir in DEFAULT_LOCATIONS:
        pkg_info_file = os.path.join(paths.NACLPORTS_ROOT, subdir, dep,
                                     'pkg_info')

        if os.path.exists(pkg_info_file):
            dep_dict['version'] = package.Package(
                info_file=pkg_info_file).VERSION
            return

    raise Error("Package not found: %s" % dep)
示例#2
0
 def testInvalidArchDisabled(self):
   pkg = package.Package()
   with self.assertRaisesRegexp(error.Error, 'invalid architecture: foo'):
     pkg.ParseInfo(test_info + 'DISABLED_ARCH=(foo)')
示例#3
0
 def testInvalidToolchainDisabled(self):
   pkg = package.Package()
   with self.assertRaisesRegexp(error.Error, 'invalid toolchain: foo'):
     pkg.ParseInfo(test_info + 'DISABLED_TOOLCHAIN=(foo)')
示例#4
0
 def testValidArchDisabled(self): # pylint: disable=no-self-use
   pkg = package.Package()
   pkg.ParseInfo(test_info + 'DISABLED_ARCH=(arm i686 x86_64)')
示例#5
0
 def testValidToolchainDisabled(self): # pylint: disable=no-self-use
   pkg = package.Package()
   pkg.ParseInfo(test_info + 'DISABLED_TOOLCHAIN=(newlib glibc clang-newlib)')
示例#6
0
 def testInvalidLibcDisabled(self):
   pkg = package.Package()
   # clang-newlib is TOOLCHAIN, not a LIBC
   with self.assertRaisesRegexp(error.Error, 'invalid libc: clang-newlib'):
     pkg.ParseInfo(test_info + 'DISABLED_LIBC=(clang-newlib)')
示例#7
0
 def testValidLibcDisabled(self): # pylint: disable=no-self-use
   pkg = package.Package()
   pkg.ParseInfo(test_info + 'DISABLED_LIBC=(newlib glibc bionic)')
示例#8
0
 def testValidArchDisabled(self):
   pkg = package.Package()
   pkg.ParseInfo(test_info + 'DISABLED_ARCH=(arm i686 x86_64)')
示例#9
0
 def testValidLibcDisabled(self):
   pkg = package.Package()
   pkg.ParseInfo(test_info + 'DISABLED_LIBC=(newlib glibc bionic)')