Package gbp :: Package deb :: Module policy :: Class DebianPkgPolicy
[hide private]
[frames] | no frames]

Class DebianPkgPolicy

   object --+    
            |    
pkg.PkgPolicy --+
                |
               DebianPkgPolicy

Packaging policy for Debian Source Packages

>>> DebianPkgPolicy.is_valid_upstreamversion('1:9.8.4.dfsg.P1-6')
True
>>> DebianPkgPolicy.is_valid_upstreamversion('-1')
False
Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from pkg.PkgPolicy: is_valid_orig_archive, is_valid_packagename, is_valid_upstreamversion

Static Methods [hide private]
str
build_tarball_name(name, version, compression, dir=None)
Given a source package's name, version and compression return the name of the corresponding upstream tarball.

Inherited from pkg.PkgPolicy: guess_upstream_src_version, has_orig, symlink_orig

Class Variables [hide private]
  packagename_re = re.compile(r'^[a-zA-Z0-9][a-zA-Z0-9\.\+-~]+$')
  packagename_msg = 'Package names must be at least two characte...
  upstreamversion_re = re.compile(r'^[0-9][a-zA-Z0-9\.\+-:~]*$')
  upstreamversion_msg = 'Upstream version numbers must start wit...
  debianversion_chars = 'a-zA-Z\\d.~+-'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

build_tarball_name(name, version, compression, dir=None)
Static Method

 

Given a source package's name, version and compression return the name of the corresponding upstream tarball.

>>> DebianPkgPolicy.build_tarball_name('foo', '1.0', 'bzip2')
'foo_1.0.orig.tar.bz2'
>>> DebianPkgPolicy.build_tarball_name('bar', '0.0~git1234', 'xz')
'bar_0.0~git1234.orig.tar.xz'
Parameters:
  • name (str) - the source package's name
  • version (str) - the upstream version
  • compression (str) - the desired compression
  • dir (str) - a directory to prepend
Returns: str
the tarballs name corresponding to the input parameters

Class Variable Details [hide private]

packagename_msg

Value:
'''Package names must be at least two characters long, start with an
    alphanumeric and can only containg letters (a-z,A-Z), digits
    (0-9), plus signs (+), minus signs (-), periods (.) and hyphens (~\
)'''

upstreamversion_msg

Value:
'''Upstream version numbers must start with a digit and can only conta\
ing lower case
    letters (a-z), digits (0-9), full stops (.), plus signs (+), minus\
 signs
    (-), colons (:) and tildes (~)'''