Пример #1
0
    def strip_libraries(self, arch):
        info('Stripping libraries')
        if self.ctx.python_recipe.from_crystax:
            info('Python was loaded from CrystaX, skipping strip')
            return
        env = arch.get_env()
        strip = which('arm-linux-androideabi-strip', env['PATH'])
        if strip is None:
            warning('Can\'t find strip in PATH...')
            return
        strip = sh.Command(strip)

        libs_dir = join(self.dist_dir, '_python_bundle',
                        '_python_bundle', 'modules')
        if self.ctx.python_recipe.name == 'python2legacy':
            libs_dir = join(self.dist_dir, 'private')
        filens = shprint(sh.find, libs_dir, join(self.dist_dir, 'libs'),
                         '-iname', '*.so', _env=env).stdout.decode('utf-8')

        logger.info('Stripping libraries in private dir')
        for filen in filens.split('\n'):
            try:
                strip(filen, _env=env)
            except sh.ErrorReturnCode_1:
                logger.debug('Failed to strip ' + filen)
Пример #2
0
    def strip_libraries(self, arch):
        info('Stripping libraries')
        env = arch.get_env()
        tokens = shlex.split(env['STRIP'])
        strip = sh.Command(tokens[0])
        if len(tokens) > 1:
            strip = strip.bake(tokens[1:])

        libs_dir = join(self.dist_dir, '_python_bundle', '_python_bundle',
                        'modules')
        filens = shprint(sh.find,
                         libs_dir,
                         join(self.dist_dir, 'libs'),
                         '-iname',
                         '*.so',
                         _env=env).stdout.decode('utf-8')

        logger.info('Stripping libraries in private dir')
        for filen in filens.split('\n'):
            if not filen:
                continue  # skip the last ''
            try:
                strip(filen, _env=env)
            except sh.ErrorReturnCode_1:
                logger.debug('Failed to strip ' + filen)
Пример #3
0
    def strip_libraries(self, arch):
        info('Stripping libraries')
        if self.ctx.python_recipe.from_crystax:
            info('Python was loaded from CrystaX, skipping strip')
            return
        env = arch.get_env()
        tokens = shlex.split(env['STRIP'])
        strip = sh.Command(tokens[0])
        if len(tokens) > 1:
            strip = strip.bake(tokens[1:])

        libs_dir = join(self.dist_dir, '_python_bundle',
                        '_python_bundle', 'modules')
        if self.ctx.python_recipe.name == 'python2legacy':
            libs_dir = join(self.dist_dir, 'private')
        filens = shprint(sh.find, libs_dir, join(self.dist_dir, 'libs'),
                         '-iname', '*.so', _env=env).stdout.decode('utf-8')

        logger.info('Stripping libraries in private dir')
        for filen in filens.split('\n'):
            if not filen:
                continue  # skip the last ''
            try:
                strip(filen, _env=env)
            except sh.ErrorReturnCode_1:
                logger.debug('Failed to strip ' + filen)
Пример #4
0
def temp_directory():
    temp_dir = mkdtemp()
    try:
        logger.debug(''.join((Err_Fore.CYAN, ' + temp directory used ',
                              temp_dir, Err_Fore.RESET)))
        yield temp_dir
    finally:
        shutil.rmtree(temp_dir)
        logger.debug(''.join((Err_Fore.CYAN, ' - temp directory deleted ',
                              temp_dir, Err_Fore.RESET)))
Пример #5
0
def temp_directory():
    temp_dir = mkdtemp()
    try:
        logger.debug(''.join((Err_Fore.CYAN, ' + temp directory used ',
                              temp_dir, Err_Fore.RESET)))
        yield temp_dir
    finally:
        shutil.rmtree(temp_dir)
        logger.debug(''.join((Err_Fore.CYAN, ' - temp directory deleted ',
                              temp_dir, Err_Fore.RESET)))
Пример #6
0
 def strip_libraries(self, arch):
     info('Stripping libraries')
     env = arch.get_env()
     strip = which('arm-linux-androideabi-strip', env['PATH'])
     if strip is None:
         warning('Can\'t find strip in PATH...')
         return
     strip = sh.Command(strip)
     filens = shprint(sh.find, join(self.dist_dir, 'private'),
                      join(self.dist_dir, 'libs'),
                      '-iname', '*.so', _env=env).stdout.decode('utf-8')
     logger.info('Stripping libraries in private dir')
     for filen in filens.split('\n'):
         try:
             strip(filen, _env=env)
         except sh.ErrorReturnCode_1:
             logger.debug('Failed to strip ' + filen)
Пример #7
0
 def strip_libraries(self, arch):
     info('Stripping libraries')
     env = arch.get_env()
     strip = which('arm-linux-androideabi-strip', env['PATH'])
     if strip is None:
         warning('Can\'t find strip in PATH...')
         return
     strip = sh.Command(strip)
     filens = shprint(sh.find,
                      join(self.dist_dir, 'private'),
                      join(self.dist_dir, 'libs'),
                      '-iname',
                      '*.so',
                      _env=env).stdout.decode('utf-8')
     logger.info('Stripping libraries in private dir')
     for filen in filens.split('\n'):
         try:
             strip(filen, _env=env)
         except sh.ErrorReturnCode_1:
             logger.debug('Failed to strip ' + filen)