예제 #1
0
    async def extract(self):
        m.action(_('Extracting tarball to %s') % self.build_dir,
                 logfile=get_logfile(self))
        if os.path.exists(self.build_dir):
            shutil.rmtree(self.build_dir)

        unpack_dir = self.config.sources
        if self.tarball_is_bomb:
            unpack_dir = self.build_dir
        await self.extract_tarball(unpack_dir)

        if self.tarball_dirname is not None:
            extracted = os.path.join(unpack_dir, self.tarball_dirname)
            # Since we just extracted this, a Windows anti-virus might still
            # have a lock on files inside it.
            shell.windows_proof_rename(extracted, self.build_dir)

        git.init_directory(self.build_dir, logfile=get_logfile(self))
        for patch in self.patches:
            if not os.path.isabs(patch):
                patch = self.relative_path(patch)
            if self.strip == 1:
                git.apply_patch(patch,
                                self.build_dir,
                                logfile=get_logfile(self))
            else:
                shell.apply_patch(patch,
                                  self.build_dir,
                                  self.strip,
                                  logfile=get_logfile(self))
예제 #2
0
 def extract(self):
     m.action(_('Extracting tarball to %s') % self.build_dir)
     if os.path.exists(self.build_dir):
         shutil.rmtree(self.build_dir)
     shell.unpack(self.download_path, self.config.sources)
     if self.tarball_dirname is not None:
         os.rename(os.path.join(self.config.sources, self.tarball_dirname),
                 self.build_dir)
     git.init_directory(self.build_dir)
     for patch in self.patches:
         if not os.path.isabs(patch):
             patch = self.relative_path(patch)
         if self.strip == 1:
             git.apply_patch(patch, self.build_dir)
         else:
             shell.apply_patch(patch, self.build_dir, self.strip)
예제 #3
0
파일: source.py 프로젝트: abuecher/cerbero
 def extract(self):
     m.action(_('Extracting tarball to %s') % self.build_dir)
     if os.path.exists(self.build_dir):
         shutil.rmtree(self.build_dir)
     try:
         shell.unpack(self.download_path, self.config.sources)
     except (IOError, EOFError, tarfile.ReadError):
         m.action(_('Corrupted or partial tarball, redownloading...'))
         self.fetch(redownload=True)
         shell.unpack(self.download_path, self.config.sources)
     if self.tarball_dirname is not None:
         os.rename(os.path.join(self.config.sources, self.tarball_dirname),
                   self.build_dir)
     git.init_directory(self.build_dir)
     for patch in self.patches:
         if not os.path.isabs(patch):
             patch = self.relative_path(patch)
         if self.strip == 1:
             git.apply_patch(patch, self.build_dir)
         else:
             shell.apply_patch(patch, self.build_dir, self.strip)
예제 #4
0
 def extract(self):
     m.action(_('Extracting tarball to %s') % self.build_dir)
     if os.path.exists(self.build_dir):
         shutil.rmtree(self.build_dir)
     try:
         shell.unpack(self.download_path, self.config.sources)
     except (IOError, EOFError, tarfile.ReadError):
         m.action(_('Corrupted or partial tarball, redownloading...'))
         self.fetch(redownload=True)
         shell.unpack(self.download_path, self.config.sources)
     if self.tarball_dirname is not None:
         os.rename(os.path.join(self.config.sources, self.tarball_dirname),
                 self.build_dir)
     git.init_directory(self.build_dir)
     for patch in self.patches:
         if not os.path.isabs(patch):
             patch = self.relative_path(patch)
         if self.strip == 1:
             git.apply_patch(patch, self.build_dir)
         else:
             shell.apply_patch(patch, self.build_dir, self.strip)