def manifest(self): manifest_name = DEFAULT_MANIFEST egginfo = self.configuration['egginfo'] if 'manifest' in egginfo: manifest_name = egginfo['manifest'].as_file() files = Paths(verify=False) files.listdir(self.prefix) return files.as_manifest(*parse_manifest(manifest_name))
def install(self): __status__ = u"Install files." target_directory = self.directory for filename, parts in self.files: archive = open_archive(filename, 'r') if archive is not None: extract_path = tempfile.mkdtemp('monteur.archive') extracted = archive.extract(extract_path) try: if parts: for source_part, destination_part in parts: files = extracted.as_dict( prefixes={source_part: destination_part}) if not files: raise ConfigurationError( u'Missing wanted path in archive') self.install_files( extract_path, target_directory, files) else: self.install_files( extract_path, target_directory, extracted.as_dict()) finally: shutil.rmtree(extract_path) else: if not os.path.isdir(filename): raise ConfigurationError( u"Cannot not directly install files, only directories", filename) files = Paths(verify=False) files.listdir(filename) if parts: for source_part, destination_part in parts: part_files = files.as_dict( prefixes={source_part: destination_part}) if not part_files: raise ConfigurationError( u'Missing wanted path in archive') self.install_files( filename, target_directory, part_files) else: target_path = os.path.join( target_directory, os.path.basename(filename)) self.install_files( target_path, target_directory, files)
def install(self, path): egg_info = self.configuration['egginfo'] manifest_url = egg_info['manifest'].as_file() files = Paths(verify=False) files.listdir(self.distribution.package_path) prefixes = [] if 'source' in egg_info: prefixes = [egg_info['source'].as_text()] for filename, info in files.as_manifest(*parse_manifest(manifest_url), prefixes=prefixes): install_file(info['full'], os.path.join(path, filename)) # XXX This needs review # if self.distribution.extensions: # builder.install( # self.distribution, install_path, self.interpretor) write_egg_info(self.distribution, package_path=path)