"""
copy a source tree over via tar
@param orig_dir: where to copy from
- @param exclude: tar exclude pattern
+ @type orig_dir: string
+ @param filters: tar exclude pattern
+ @type filters: list of strings
@return: list of copied files
@rtype: list
"""
def add_config_file_option(self, option_name, dest, help=None, **kwargs):
"""
set a option for the command line parser, the default is read from the config file
- @var option_name: name of the option
+ @param option_name: name of the option
@type option_name: string
- @var dest: where to store this option
+ @param dest: where to store this option
@type dest: string
- @var help: help text
+ @param help: help text
@type help: string
"""
if not help:
def add_config_file_option(self, option_name, dest, help=None, **kwargs):
"""
set a option for the command line parser, the default is read from the config file
- @var option_name: name of the option
+ @param option_name: name of the option
@type option_name: string
- @var dest: where to store this option
+ @param dest: where to store this option
@type dest: string
- @var help: help text
+ @param help: help text
@type help: string
"""
if not help:
(True, None). Returns (False, None) if the current version is up to date.
@param out: uscan output
- @param type: string
+ @type out: string
@return: status and tarball name
@rtype: tuple
>>> parse_uscan("<status>up to date</status>")
"""
guess the package name and version from the filename of an upstgream
archive. Returns a tuple with package name and version, or None.
- @archive: filename to guess to version for
- @extra_regex: additional regex to apply, needs a 'package' and a
- 'version' group
+ @param archive: filename to guess to version for
+ @param extra_regex: additional regex to apply, needs a 'package' and a
+ 'version' group
>>> guess_upstream_version('foo-bar_0.2.orig.tar.gz')
('foo-bar', '0.2')
('kvm', '87+dfsg')
>>> guess_upstream_version('foo-Bar_0.2.orig.tar.gz')
>>> guess_upstream_version('foo-Bar-a.b.tar.gz')
-
"""
version_chars = r'[a-zA-Z\d\.\~\-\:\+]'
extensions = r'\.tar\.(gz|bz2)'
You only need to use this funciton if you also need to check for legacy
tags.
- @param pattern: tag pattern
+ @param format: tag pattern
@param version: debian version number
@return: sha1 of the version tag
"""
author={}, committer={}):
"""Replace the current tip of branch 'branch' with the contents from 'unpack_dir'
@param unpack_dir: content to add
+ @type unpack_dir: striing
@param msg: commit message to use
+ @type msg: string
@param branch: branch to add the contents of unpack_dir to
- @param parents: additional parents of this commit
- @param author: commit with author information from author
+ @type branch: string
+ @param other_parents: additional parents of this commit
+ @type other_parents: list string
+ @param author: author information to use for commit
@type author: dict with keys 'name', 'email', 'date'
- @param committer_author: commit with committer information from committer
- @type comitter: dict with keys 'name', 'email', 'date'"""
+ @param committer: committer information to use for commit
+ @type committer: dict with keys 'name', 'email', 'date'"""
self.__check_path()
git_index_file = os.path.join(self.path, '.git', 'gbp_index')
Determine if the upstream sources needs to be repacked
We repack if
- * we want to filter out files and use pristine tar since we want
- to make a filtered tarball available to pristine-tar
- * when we don't have a suitable upstream tarball (e.g. zip archive or unpacked dir)
- and want to use filters
- * when we don't have a suitable upstream tarball (e.g. zip archive or unpacked dir)
- and want to use pristine-tar
+ 1. we want to filter out files and use pristine tar since we want
+ to make a filtered tarball available to pristine-tar
+ 2. when we don't have a suitable upstream tarball (e.g. zip archive or unpacked dir)
+ and want to use filters
+ 3. when we don't have a suitable upstream tarball (e.g. zip archive or unpacked dir)
+ and want to use pristine-tar
"""
if ((options.pristine_tar and options.filter_pristine_tar and len(options.filters) > 0)):
return True
def ask_package_name(default):
"""
Ask the user for the source package name.
- @default The default package name to suggest to the user.
+ @param default: The default package name to suggest to the user.
"""
while True:
sourcepackage = raw_input("What will be the source package name? [%s] " % default)
def ask_package_version(default):
"""
Ask the user for the upstream package version.
- @default The default package version to suggest to the user.
+ @param default: The default package version to suggest to the user.
"""
while True:
version = raw_input("What is the upstream version? [%s] " % default)
def find_source(options, args):
"""Find the tarball to import - either via uscan or via command line argument
@return: upstream source filename or None if nothing to import
- @rvalue: string
+ @rtype: string
@raise GbpError: raised on all detected errors
"""
if options.uscan: # uscan mode