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

Class SpecFile

object --+
         |
        SpecFile
Known Subclasses:

Class for parsing/modifying spec files

Instance Methods [hide private]
 
__init__(self, filename=None, filedata=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
_delete_special_macro(self, name, identifier)
Delete a special macro line in spec file content
 
_delete_tag(self, tag, num)
Delete a tag
 
_guess_orig_file(self)
Try to guess the name of the primary upstream/source archive.
 
_guess_orig_prefix(self, orig)
Guess prefix for the orig file
 
_macro_replace(self, matchobj)
 
_parse_content(self)
Go through spec file content line-by-line and (re-)parse info from it
 
_parse_directive(self, lineobj)
Parse special directive/scriptlet/macro lines
 
_parse_filtered_spec(self, skip_tags)
Parse a filtered spec file in rpm-python
 
_parse_gbp_tag(self, linenum, lineobj)
Parse special git-buildpackage tags
 
_parse_tag(self, lineobj)
Parse tag line
 
_patches(self)
Get all patch tags as a dict
 
_set_section(self, name, text)
Update/create a complete section in spec file.
 
_set_special_macro(self, name, identifier, args, insertafter)
Update a special macro line in spec file content
 
_set_tag(self, tag, num, value, insertafter)
Set a tag value
 
_sources(self)
Get all source tags as a dict
 
get_changelog(self)
Get the %changelog section
str
macro_expand(self, text)
Expand the rpm macros (that gbp knows of) in the given text.
 
patchseries(self, unapplied=False, ignored=False)
Return non-ignored patches of the RPM as a gbp patchseries
 
set_changelog(self, text)
Update or create the %changelog section
 
set_tag(self, tag, num, value, insertafter=None)
Update a tag in spec file content
 
sources(self)
Get all source tags as a dict
 
update_patches(self, patches, commands)
Update spec with new patch tags and patch macros
 
write_spec_file(self)
Write, possibly updated, spec to disk

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

Static Methods [hide private]
 
_patch_macro_opts(args)
Parse arguments of the '%patch' macro
 
_setup_macro_opts(args)
Parse arguments of the '%setup' macro
Class Variables [hide private]
  directive_re = re.compile(r'(?i)^%(?P<name>[a-z]+)(?P<num>[0-9...
  gbptag_re = re.compile(r'(?i)^\s*#\s*gbp-(?P<name>[a-z-]+)(\s*...
  section_identifiers = ('package', 'description', 'prep', 'buil...
  tag_re = re.compile(r'(?i)^(?P<name>[a-z]+)(?P<num>[0-9]+)?\s*...
Properties [hide private]
  ignorepatches
Get numbers of ignored patches as a sorted list
  specpath
Get the dir/filename
  version
Get the (downstream) version

Inherited from object: __class__

Method Details [hide private]

__init__(self, filename=None, filedata=None)
(Constructor)

 

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

Overrides: object.__init__
(inherited documentation)

_guess_orig_file(self)

 

Try to guess the name of the primary upstream/source archive. Returns a dict with all the relevant information.

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]

directive_re

Value:
re.compile(r'(?i)^%(?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.*))?\
$')

section_identifiers

Value:
('package',
 'description',
 'prep',
 'build',
 'install',
 'clean',
 'check',
 'pre',
...

tag_re

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

Property Details [hide private]

ignorepatches

Get numbers of ignored patches as a sorted list

Get Method:
unreachable.ignorepatches(self) - Get numbers of ignored patches as a sorted list

specpath

Get the dir/filename

Get Method:
unreachable.specpath(self) - Get the dir/filename

version

Get the (downstream) version

Get Method:
unreachable.version(self) - Get the (downstream) version