Package gbp :: Package rpm :: Class SpecFile
[hide private]
[frames] | no frames]

Class SpecFile

object --+
         |
        SpecFile

Class for parsing/modifying spec files

Instance Methods [hide private]
 
__init__(self, specfile, skip_tags=('ExcludeArch', 'ExcludeOS', 'ExclusiveArch', 'ExclusiveOS', '...)
x.__init__(...) initializes x; see help(type(x)) for signature
 
_get_version(self)
Get the (downstream) version
 
_get_orig_src(self)
Get the orig src
 
_macro_replace(self, matchobj)
str
macro_expand(self, text)
Expand the rpm macros (that gbp knows of) in the given text.
 
write_spec_file(self)
Write, possibly updated, spec to disk
 
parse_content(self)
Go through spec file content line-by-line and (re-)parse info from it
 
set_tag(self, tag, value)
Update a tag in spec file content
 
update_patches(self, patchfilenames)
Update spec with new patch tags and patch macros.
 
patchseries(self)
Return patches of the RPM as a gbp patchseries
 
guess_orig_file(self)
Try to guess the name of the primary upstream/source archive returns a tuple with full file path, filename base, archive format and compression method.

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

Class Variables [hide private]
  tag_re = re.compile(r'(?i)^(?P<name>[a-z]+)(?P<num>[0-9]+)?\s*...
  macro_re = re.compile(r'^%(?P<name>[a-z]+)(?P<num>[0-9]+)?(\s+...
  gbptag_re = re.compile(r'(?i)^\s*#\s*gbp-(?P<name>[a-z-]+)(\s*...
Properties [hide private]
  version
Get the (downstream) version
  orig_src
Get the orig src

Inherited from object: __class__

Method Details [hide private]

__init__(self, specfile, skip_tags=('ExcludeArch', 'ExcludeOS', 'ExclusiveArch', 'ExclusiveOS', '...)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

macro_expand(self, text)

 

Expand the rpm macros (that gbp knows of) in the given text.

Parameters:
  • text (str) - text to check for macros
Returns: str
text with macros expanded

Class Variable Details [hide private]

tag_re

Value:
re.compile(r'(?i)^(?P<name>[a-z]+)(?P<num>[0-9]+)?\s*:\s*(?P<value>\S(\
.*\S)?)\s*$')

macro_re

Value:
re.compile(r'^%(?P<name>[a-z]+)(?P<num>[0-9]+)?(\s+(?P<args>.*))?$')

gbptag_re

Value:
re.compile(r'(?i)^\s*#\s*gbp-(?P<name>[a-z-]+)(\s*:\s*(?P<args>\S.*))?\
$')

Property Details [hide private]

version

Get the (downstream) version

Get Method:
_get_version(self) - Get the (downstream) version

orig_src

Get the orig src

Get Method:
_get_orig_src(self) - Get the orig src