Пример #1
0
 def add_exe(logger_why_already_in_self, file):
     if (
         not os.path.islink(file)
         and not os.path.splitext(file)[1]
         and loggedos.read_pipe(
             logger_why_already_in_self, self.expand("file -b %(file)s", locals())
         ).startswith("MS-DOS executable PE")
     ):
         loggedos.system(logger_why_already_in_self, self.expand("mv %(file)s %(file)s.exe", locals()))
Пример #2
0
 def add_exe(logger_why_already_in_self, file):
     if (not os.path.islink(file) and not os.path.splitext(file)[1]
             and loggedos.read_pipe(
                 logger_why_already_in_self,
                 self.expand(
                     'file -b %(file)s',
                     locals())).startswith('MS-DOS executable PE')):
         loggedos.system(
             logger_why_already_in_self,
             self.expand('mv %(file)s %(file)s.exe', locals()))
Пример #3
0
Файл: gcc.py Проект: epronk/gub
 def rewire_one (logger, file):
     found_skips = [s for s in skip_libs if file.find (s) >= 0]
     if found_skips:
         return
     id = loggedos.read_pipe (logger,
                              self.expand ('%(toolchain_prefix)sotool -L %(file)s', 
                                          locals ()),
                              env=self.get_substitution_dict ()).split ()[1]
     id = os.path.split (id)[1]
     loggedos.system (logger, 
                      self.expand ('%(toolchain_prefix)sinstall_name_tool -id /usr/lib/%(id)s %(file)s',
                                   locals ()),
                      env=self.get_substitution_dict ())
Пример #4
0
 def rewire_one (logger, file):
     found_skips = [s for s in skip_libs if file.find (s) >= 0]
     if found_skips:
         return
     id = loggedos.read_pipe (logger,
                              self.expand ('%(toolchain_prefix)sotool -L %(file)s', 
                                          locals ()),
                              env=self.get_substitution_dict ()).split ()[1]
     id = os.path.split (id)[1]
     loggedos.system (logger, 
                      self.expand ('%(toolchain_prefix)sinstall_name_tool -id /usr/lib/%(id)s %(file)s',
                                   locals ()),
                      env=self.get_substitution_dict ())
Пример #5
0
    def get_libaries (self, name):
        lib_str = loggedos.read_pipe (
            self.runner.logger,
            self.expand ('%(cross_prefix)s/bin/%(target_architecture)s-otool -L %(name)s',
                         locals ()),
            ignore_errors=True)

        libs = []
        for i in lib_str.split ('\n'):
            m = re.search (r'\s+(.*) \(.*\)', i)
            if not m:
                continue
            if m.group (1) in self.ignore_libs:
                continue
            libs.append (m.group (1))
        return libs
Пример #6
0
    def get_libaries(self, name):
        lib_str = loggedos.read_pipe(
            self.runner.logger,
            self.expand(
                '%(cross_prefix)s/bin/%(target_architecture)s-otool -L %(name)s',
                locals()),
            ignore_errors=True)

        libs = []
        for i in lib_str.split('\n'):
            m = re.search(r'\s+(.*) \(.*\)', i)
            if not m:
                continue
            if m.group(1) in self.ignore_libs:
                continue
            libs.append(m.group(1))
        return libs
Пример #7
0
    def install_tarball(self, ball, name, prefix_dir):
        gub_log.action('untarring: %(ball)s\n' % locals())

        _z = misc.compression_flag(ball)
        _v = ''  # self.os_interface.verbose_flag ()
        lst = loggedos.read_pipe(gub_log.default_logger,
                                 'tar -t%(_z)s -f "%(ball)s"' %
                                 locals()).split('\n')
        conflicts = False
        installed_files = self.installed_files()
        installed_files_string = ':'.join([''] + installed_files + [''])
        misc.timing()
        for f in lst:
            if (':' + f + ':' in installed_files_string
                    and not os.path.isdir(os.path.join(self.root, f))):
                package = self._file_package_db[f]
                gub_log.error('already have file %(f)s: %(package)s\n' %
                              locals())
                conflicts = True
        gub_log.command('GUP: for f in lst:' + misc.timing() + '\n')
        if conflicts and not self.is_distro:
            raise Exception('Duplicate files found.')
        root = self.root
        loggedos.system(
            gub_log.default_logger,
            # cd %(root)s to avoid open(2) of cwd, see
            # http://lists.gnu.org/archive/html/lilypond-devel/2009-03/msg00304.html
            'cd %(root)s && tar -C %(root)s -p -x%(_z)s%(_v)s -f %(ball)s' %
            locals())
        for f in lst:
            if f.endswith('.la'):
                self.libtool_la_fixup(root, f)
            if f.endswith('.pc'):
                self.pkgconfig_pc_fixup(root, f, prefix_dir)

        self._package_file_db[name] = '\n'.join(lst)
        for f in lst:
            # ignore directories.
            if not f.endswith('/'):
                self._file_package_db[f] = name

        if os.path.exists('%(root)s/usr/etc/postinstall/%(name)s' % locals()):
            loggedos.system(
                gub_log.default_logger,
                'PATH=%(root)s/usr/bin:$PATH %(root)s/usr/etc/postinstall/%(name)s && mv %(root)s/usr/etc/postinstall/%(name)s %(root)s/usr/etc/postinstall/%(name)s.done || :'
                % locals())
Пример #8
0
    def install_tarball (self, ball, name, prefix_dir):
        logging.action ('untarring: %(ball)s\n' % locals ())

        _z = misc.compression_flag (ball)
        _v = '' # self.os_interface.verbose_flag ()
        lst = loggedos.read_pipe (logging.default_logger,
                                  'tar -t%(_z)s -f "%(ball)s"'
                                  % locals ()).split ('\n')
        conflicts = False
        installed_files = self.installed_files ()
        installed_files_string = ':'.join ([''] + installed_files + [''])
        misc.timing ()
        for f in lst:
            if (':' + f + ':' in installed_files_string
                and not os.path.isdir (os.path.join (self.root, f))):
                package = self._file_package_db[f]
                logging.error ('already have file %(f)s: %(package)s\n'
                               % locals ())
                conflicts = True
        logging.command ('GUP: for f in lst:' + misc.timing () + '\n')
        if conflicts and not self.is_distro:
            raise Exception ('Duplicate files found.')
        root = self.root
        loggedos.system (logging.default_logger,
                         # cd %(root)s to avoid open(2) of cwd, see
                         # http://lists.gnu.org/archive/html/lilypond-devel/2009-03/msg00304.html
                         'cd %(root)s && tar -C %(root)s -p -x%(_z)s%(_v)s -f %(ball)s'
                         % locals ())
        for f in lst:
            if f.endswith ('.la'):
                self.libtool_la_fixup (root, f)
            if f.endswith ('.pc'):
                self.pkgconfig_pc_fixup (root, f, prefix_dir)

        self._package_file_db[name] = '\n'.join (lst)
        for f in lst:
            # ignore directories.
            if not f.endswith ('/'):
                self._file_package_db[f] = name

        if os.path.exists ('%(root)s/usr/etc/postinstall/%(name)s' % locals ()):
            loggedos.system (logging.default_logger,
                             'PATH=%(root)s/usr/bin:$PATH %(root)s/usr/etc/postinstall/%(name)s && mv %(root)s/usr/etc/postinstall/%(name)s %(root)s/usr/etc/postinstall/%(name)s.done || :' % locals ())
Пример #9
0
 def set_ignore_libs_from_tarball(self, tarball):
     files = loggedos.read_pipe(self.runner.logger,
                                'tar -tzf %s' % tarball).split('\n')
     self.set_ignore_libs_from_files(files)
Пример #10
0
 def set_ignore_libs_from_tarball (self, tarball):
     files = loggedos.read_pipe (self.runner.logger,
                                 'tar -tzf %s' % tarball).split ('\n')
     self.set_ignore_libs_from_files (files)