Common functionality for Debian and RPM buildpackage scripts

Variable index_name Undocumented
Variable wc_names Undocumented
Function sanitize_prefix Sanitize the prefix used for generating source archives
Function compress Filter data through a compressor cmd.
Function git_archive_submodules Create a source tree archive with submodules.
Function git_archive_single Create an archive without submodules
Function untar_data Extract tar provided as an iterable
Function dump_tree Dump a git tree-ish to output_dir
Function wc_index Get path of the temporary index file used for exporting working copy
Function write_wc write out the current working copy as a treeish object
Function drop_index drop our custom index
Function clone_index Copy the current index file to our custom index file
index_name =
Undocumented
(type: str)
wc_names =
Undocumented
(type: Dict)
def sanitize_prefix(prefix):

Sanitize the prefix used for generating source archives

>>> sanitize_prefix('')
'/'
>>> sanitize_prefix('foo/')
'foo/'
>>> sanitize_prefix('/foo/bar')
'foo/bar/'
def compress(cmd, options, output, input_data=None):

Filter data through a compressor cmd.

For better performance input_data should feed data in bigger chunks.

def git_archive_submodules(repo, treeish, output, tmpdir_base, prefix, comp_type, comp_level, comp_opts, format="""tar"""):

Create a source tree archive with submodules.

Since git-archive always writes an end of tarfile trailer we concatenate the generated archives using tar and compress the result.

Exception handling is left to the caller.

def git_archive_single(repo, treeish, output, prefix, comp_type, comp_level, comp_opts, format="""tar"""):

Create an archive without submodules

Exception handling is left to the caller.

def untar_data(outdir, data):

Extract tar provided as an iterable

def dump_tree(repo, export_dir, treeish, with_submodules, recursive=(True)):

Dump a git tree-ish to output_dir

def wc_index(repo):

Get path of the temporary index file used for exporting working copy

def write_wc(repo, force=(True), untracked=(True)):

write out the current working copy as a treeish object

def drop_index(repo):

drop our custom index

def clone_index(repo):

Copy the current index file to our custom index file

API Documentation for git-buildpackage, generated by pydoctor at 2020-05-22 08:50:00.