parameters: (self, c: Config)
return_statement: return True
docstring: Extract the archive and apply additional patches (if needed).
docstring_summary: Extract the archive and apply additional patches (if needed).
docstring_tokens: Extract the archive and apply additional patches ( if needed ) .
function: def prepare_sources(self, c: Config) -> bool:
          """Extract the archive and apply additional patches (if needed)."""
          src_directory = self.src_directory(c)
          if os.path.exists(src_directory):
              logging.debug("'%s' already extracted", self.archive)
              return True
  
          archive = self.archive_path(c)
          if not os.path.exists(archive):
              logging.error("'%s' does not exist!", self.archive)
              return False
  
          # Do not use c.dependencies_src_dir directly, sub-classes may override.
          extract_dir = os.path.dirname(self.src_directory(c))
          shutil.unpack_archive(archive, extract_dir)
  
          self.apply_patches(c)
  
          return True
function_tokens: def prepare_sources ( self , c : Config ) -> bool : src_directory = self . src_directory ( c ) if os . path . exists ( src_directory ) : logging . debug ( "'%s' already extracted" , self . archive ) return True archive = self . archive_path ( c ) if not os . path . exists ( archive ) : logging . error ( "'%s' does not exist!" , self . archive ) return False # Do not use c.dependencies_src_dir directly, sub-classes may override. extract_dir = os . path . dirname ( self . src_directory ( c ) ) shutil . unpack_archive ( archive , extract_dir ) self . apply_patches ( c ) return True