Package gbp :: Package rpm :: Module policy :: Class RpmPkgPolicy

[hide private]
[frames] | no frames]

# Class RpmPkgPolicy

       object --+
                |
    pkg.PkgPolicy --+
                    |
                   RpmPkgPolicy

Packaging policy for RPM

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]

`bool`

    >>> RpmPkgPolicy.is_valid_orig_archive("foo/bar_baz.tar.gz")
    True
    >>> RpmPkgPolicy.is_valid_orig_archive("foo.bar.tar")
    True
    >>> RpmPkgPolicy.is_valid_orig_archive("foo.bar")
    False
    >>> RpmPkgPolicy.is_valid_orig_archive("foo.gz")
    False

is_valid_orig_archive(cls, filename) Is this a valid orig source archive |

Inherited from `pkg.PkgPolicy`: `is_valid_packagename`, `is_valid_upstreamversion`

Static Methods | [hide private]

Inherited from `pkg.PkgPolicy`: `guess_upstream_src_version`, `has_orig`, `symlink_orig`

Class Variables | [hide private]

| python_rpmlib_module_name = ``'``rpm``'``
| alnum = ``'``a-zA-Z0-9``'``
| name_whitelist_chars = ``'``._+%{}\\-``'``
| version_whitelist_chars = ``'``._+%{}~``'``
| 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``...``

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### is_valid_orig_archive(cls, filename)
Class Method

Is this a valid orig source archive

Parameters:
  - `filename` (`str`) - upstream source archive filename
Returns: `bool`

    >>> RpmPkgPolicy.is_valid_orig_archive("foo/bar_baz.tar.gz")
    True
    >>> RpmPkgPolicy.is_valid_orig_archive("foo.bar.tar")
    True
    >>> RpmPkgPolicy.is_valid_orig_archive("foo.bar")
    False
    >>> RpmPkgPolicy.is_valid_orig_archive("foo.gz")
    False

  true if valid upstream source archive filename

Class Variable Details | [hide private]

### packagename_re

Value:

      re.compile(r'^[a-zA-Z0-9][a-zA-Z0-9\._\+%\{\}-]+$')

### packagename_msg

Value:

      'Package names must be at least two characters long, start with an alp
      hanumeric and can only contain alphanumerics or characters in [\'.\',
      \'_\', \'+\', \'%\', \'{\', \'}\', \'\\\\\', \'-\']'

### upstreamversion_re

Value:

      re.compile(r'^[0-9][a-zA-Z0-9\._\+%\{\}~]*$')

### upstreamversion_msg

Value:

      'Upstream version numbers must start with a digit and can only contain
      g alphanumerics or characters in [\'.\', \'_\', \'+\', \'%\', \'{\', \
      '}\', \'~\']'