Carthage Files Module

class carthage.files.CdContext(path, iso_name, *options)

Builds a temporary CD. Typical usage:

iso_builder = CdContext(self.stamp_path 'cidata', '-Vcidata')
async with iso_builder as cd_info_path:
    # write stuff out into directories under cd_info_path
# iso_builder.iso_path contains an iso with the information from path
#genisoimage will be called with -Vcidata per options
Parameters:
  • path – A path under which to create the cd and temporary directory.

  • iso_name – The name of the CD to create; the final output is path/iso_name

  • *options

    any remaining positional arguments are passed as genisoimage options.

property iso_path: Path

If the context has been exited, return the path to the CD. Else raise

carthage.files.checkout_git_repo(url, repo, *, injector, foreground=False, branch=None)

Checkout a git repo. :param repo: where to put the repo; the path is not adjusted, so if it should be relative to checkout_dir, that’s the caller’s responsibility.

carthage.files.git_checkout_task(url, repo)

Returns a setup_task() that will checkout a give git repository. The resulting setup_task has an attribute repo_path which is a function returning the path to the repo

carthage.files.git_tree_hash(git_tree)

Return the HEAD of a git tree suitable for use in a setup_task’s hash function

async carthage.files.rsync_git_tree(git_tree, target: RsyncPath, *, config, ainjector)

Copy a git tree into a target system.

Clone the HEAD of a Git working copy into a new temporary directory This preserves committed files but does not preserve untracked or uncommitted files. Rsync that directory to the path on a remote system indicated by target.