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
 
update_patches(self, patchfilenames)
Update spec by putting autoupdate markers Returns the number of lines added
 
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.
 
debugprint(self)
Print info about the spec in readable way

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

Class Variables [hide private]
  source_re = re.compile(r'(?i)^Source(?P<srcnum>[0-9]+)?\s*:\s*...
  patchtag_re = re.compile(r'(?i)^Patch(?P<patchnum>[0-9]+)?\s*:...
  patchmacro_re = re.compile(r'^%patch(?P<patchnum>[0-9]+)?(\s+(...
  setupmacro_re = re.compile(r'^%setup(\s+(?P<args>.*))?$')
  marker_re = re.compile(r'^#\s+(?P<marker>>>|<<)\s+(?P<what>gbp...
  gbptag_re = re.compile(r'(?i)^\s*#\s*gbp(?P<tagname>[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]

source_re

Value:
re.compile(r'(?i)^Source(?P<srcnum>[0-9]+)?\s*:\s*(?P<name>[^\s].*[^\s\
])\s*$')

patchtag_re

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

patchmacro_re

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

marker_re

Value:
re.compile(r'^#\s+(?P<marker>>>|<<)\s+(?P<what>gbp-[^\s]+)\s*(?P<comme\
nt>.*)$')

gbptag_re

Value:
re.compile(r'(?i)^\s*#\s*gbp(?P<tagname>[a-z]+)\s*:\s*(?P<data>\S.*)\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