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)
def testInvalidArchDisabled(self): pkg = package.Package() with self.assertRaisesRegexp(error.Error, 'invalid architecture: foo'): pkg.ParseInfo(test_info + 'DISABLED_ARCH=(foo)')
def testInvalidToolchainDisabled(self): pkg = package.Package() with self.assertRaisesRegexp(error.Error, 'invalid toolchain: foo'): pkg.ParseInfo(test_info + 'DISABLED_TOOLCHAIN=(foo)')
def testValidArchDisabled(self): # pylint: disable=no-self-use pkg = package.Package() pkg.ParseInfo(test_info + 'DISABLED_ARCH=(arm i686 x86_64)')
def testValidToolchainDisabled(self): # pylint: disable=no-self-use pkg = package.Package() pkg.ParseInfo(test_info + 'DISABLED_TOOLCHAIN=(newlib glibc clang-newlib)')
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)')
def testValidLibcDisabled(self): # pylint: disable=no-self-use pkg = package.Package() pkg.ParseInfo(test_info + 'DISABLED_LIBC=(newlib glibc bionic)')
def testValidArchDisabled(self): pkg = package.Package() pkg.ParseInfo(test_info + 'DISABLED_ARCH=(arm i686 x86_64)')
def testValidLibcDisabled(self): pkg = package.Package() pkg.ParseInfo(test_info + 'DISABLED_LIBC=(newlib glibc bionic)')