Package gbp :: Package scripts :: Package common :: Module buildpackage
[hide private]
[frames] | no frames]

Module buildpackage

Common functionality for Debian and RPM buildpackage scripts

Functions [hide private]
 
sanitize_prefix(prefix)
Sanitize the prefix used for generating source archives
 
compress(cmd, options, output, input_data=None)
Filter data through a compressor cmd.
 
git_archive_submodules(repo, treeish, output, tmpdir_base, prefix, comp_type, comp_level, comp_opts, format='tar')
Create a source tree archive with submodules.
 
git_archive_single(repo, treeish, output, prefix, comp_type, comp_level, comp_opts, format='tar')
Create an archive without submodules
 
untar_data(outdir, data)
Extract tar provided as an iterable
    Functions to handle export-dir
 
dump_tree(repo, export_dir, treeish, with_submodules, recursive=True)
Dump a git tree-ish to output_dir
 
wc_index(repo)
Get path of the temporary index file used for exporting working copy
 
write_wc(repo, force=True, untracked=True)
write out the current working copy as a treeish object
 
drop_index(repo)
drop our custom index
 
clone_index(repo)
Copy the current index file to our custom index file
Variables [hide private]
  index_name = 'INDEX'
  wc_names = {'WC': {'force': True, 'untracked': True}, 'WC.IGNO...
  __package__ = 'gbp.scripts.common'
Function Details [hide private]

sanitize_prefix(prefix)

 

Sanitize the prefix used for generating source archives

>>> sanitize_prefix('')
'/'
>>> sanitize_prefix('foo/')
'foo/'
>>> sanitize_prefix('/foo/bar')
'foo/bar/'

compress(cmd, options, output, input_data=None)

 

Filter data through a compressor cmd.

For better performance input_data should feed data in bigger chunks.

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.

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.


Variables Details [hide private]

wc_names

Value:
{'WC': {'force': True, 'untracked': True},
 'WC.IGNORED': {'force': True, 'untracked': True},
 'WC.TRACKED': {'force': False, 'untracked': False},
 'WC.UNTRACKED': {'force': False, 'untracked': True}}