portage.sync.modules.git.git module

class portage.sync.modules.git.git.GitSync

Bases: portage.sync.syncbase.NewBase

Git sync class


Return a retry decorator, or None if retry is disabled.

If retry fails, the function reraises the exception raised by the decorated function. If retry times out and no exception is available to reraise, the function raises TimeoutError.


Sets internal variables from kwargs


Refresh keys stored in openpgp_env. Raises gemato.exceptions.GematoException or asyncio.TimeoutError on failure.


openpgp_env (gemato.openpgp.OpenPGPEnvironment) – openpgp environment


Select an appropriate implementation of RepoStorageInterface, based on repos.conf settings.

Return type



name of the selected repo storage constructor

property download_dir

Get the path of the download directory, where the repository update is staged. The directory is initialized lazily, since the repository might already be at the latest revision, and there may be some cost associated with the directory initialization.


Tests whether the repo actually exists

property has_bin

Checks for existance of the external binary, and also checks for storage driver configuration problems.

MUST only be called after _kwargs() has set the logger

static name()

Do the initial clone of the repository

post_sync(portdb, location, emerge_config)

repo.sync_type == “Blank”: # NOTE: Do this after reloading the config, in case # it did not exist prior to sync, so that the config # and portdb properly account for its existence.

property repo_storage

Get the repo storage driver instance. Raise RepoStorageException if there is a configuration problem


Get information about the head commit

short_desc = 'Perform sync operations on git based repositories'

Sync the repository


Update existing git repository, and ignore the syncuri. We are going to trust the user and assume that the user is in the branch that he/she wants updated. We’ll let the user manage branches with git directly.