class documentation

class SpecFile(object):

View In Hierarchy

Class for parsing/modifying spec files

Method __init__ Undocumented
Method get_changelog Get the %changelog section
Method macro_expand Expand the rpm macros (that gbp knows of) in the given text.
Method patchseries Return non-ignored patches of the RPM as a gbp patchseries
Method set_changelog Update or create the %changelog section
Method set_tag Update a tag in spec file content
Method sources Get all source tags as a dict
Method update_patches Update spec with new patch tags and patch macros
Method write_spec_file Write, possibly updated, spec to disk
Class Variable directive_re Undocumented
Class Variable gbptag_re Undocumented
Class Variable section_identifiers Undocumented
Class Variable tag_re Undocumented
Instance Variable epoch Undocumented
Instance Variable name Undocumented
Instance Variable orig_src Undocumented
Instance Variable packager Undocumented
Instance Variable release Undocumented
Instance Variable upstreamversion Undocumented
Property ignorepatches Get numbers of ignored patches as a sorted list
Property specpath Get the dir/filename
Property version Get the (downstream) version
Static Method _patch_macro_opts Parse arguments of the '%patch' macro
Static Method _setup_macro_opts Parse arguments of the '%setup' macro
Method _delete_special_macro Delete a special macro line in spec file content
Method _delete_tag Delete a tag
Method _guess_orig_file Try to guess the name of the primary upstream/source archive. Returns a dict with all the relevant information.
Method _guess_orig_prefix Guess prefix for the orig file
Method _macro_replace Undocumented
Method _parse_content Go through spec file content line-by-line and (re-)parse info from it
Method _parse_directive Parse special directive/scriptlet/macro lines
Method _parse_filtered_spec Parse a filtered spec file in rpm-python
Method _parse_gbp_tag Parse special git-buildpackage tags
Method _parse_tag Parse tag line
Method _patches Get all patch tags as a dict
Method _set_section Update/create a complete section in spec file.
Method _set_special_macro Update a special macro line in spec file content
Method _set_tag Set a tag value
Method _sources Get all source tags as a dict
Instance Variable _content Undocumented
Instance Variable _filtertags Undocumented
Instance Variable _gbp_tags Undocumented
Instance Variable _listtags Undocumented
Instance Variable _special_directives Undocumented
Instance Variable _specinfo Undocumented
Instance Variable _tags Undocumented
def __init__(self, filename=None, filedata=None):

Undocumented

def get_changelog(self):

Get the %changelog section

def macro_expand(self, text):

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

Parameters
text:strtext to check for macros
Returns
strtext with macros expanded
def patchseries(self, unapplied=False, ignored=False):

Return non-ignored patches of the RPM as a gbp patchseries

def set_changelog(self, text):

Update or create the %changelog section

def set_tag(self, tag, num, value, insertafter=None):

Update a tag in spec file content

def sources(self):

Get all source tags as a dict

def update_patches(self, patches, commands):

Update spec with new patch tags and patch macros

def write_spec_file(self):

Write, possibly updated, spec to disk

directive_re =

Undocumented

gbptag_re =

Undocumented

section_identifiers: tuple[str, ...] =

Undocumented

tag_re =

Undocumented

epoch =

Undocumented

name =

Undocumented

orig_src =

Undocumented

packager =

Undocumented

release =

Undocumented

upstreamversion =

Undocumented

@property
ignorepatches =

Get numbers of ignored patches as a sorted list

@property
specpath =

Get the dir/filename

@property
version =

Get the (downstream) version

@staticmethod
def _patch_macro_opts(args):

Parse arguments of the '%patch' macro

@staticmethod
def _setup_macro_opts(args):

Parse arguments of the '%setup' macro

def _delete_special_macro(self, name, identifier):

Delete a special macro line in spec file content

def _delete_tag(self, tag, num):

Delete a tag

def _guess_orig_file(self):

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

def _guess_orig_prefix(self, orig):

Guess prefix for the orig file

def _macro_replace(self, matchobj):

Undocumented

def _parse_content(self):

Go through spec file content line-by-line and (re-)parse info from it

def _parse_directive(self, lineobj):

Parse special directive/scriptlet/macro lines

def _parse_filtered_spec(self, skip_tags):

Parse a filtered spec file in rpm-python

def _parse_gbp_tag(self, linenum, lineobj):

Parse special git-buildpackage tags

def _parse_tag(self, lineobj):

Parse tag line

def _patches(self):

Get all patch tags as a dict

def _set_section(self, name, text):

Update/create a complete section in spec file.

def _set_special_macro(self, name, identifier, args, insertafter):

Update a special macro line in spec file content

def _set_tag(self, tag, num, value, insertafter):

Set a tag value

def _sources(self):

Get all source tags as a dict

_content =

Undocumented

_filtertags: tuple[str, ...] =

Undocumented

_gbp_tags =

Undocumented

_listtags =

Undocumented

_special_directives =

Undocumented

_specinfo =

Undocumented

_tags: dict =

Undocumented