Class for parsing/modifying spec files

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

Parse a filtered spec file in rpm-python

@property
def version(self):

Get the (downstream) version

@property
def specpath(self):

Get the dir/filename

@property
def ignorepatches(self):

Get numbers of ignored patches as a sorted list

def _patches(self):

Get all patch tags as a dict

def _sources(self):

Get all source tags as a dict

def sources(self):

Get all source tags as a dict

def _macro_replace(self, matchobj):
Undocumented
def macro_expand(self, text):

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

Parameterstexttext to check for macros (type: str)
Returnstext with macros expanded (type: str)
def write_spec_file(self):

Write, possibly updated, spec to disk

def _parse_tag(self, lineobj):

Parse tag line

@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 _parse_directive(self, lineobj):

Parse special directive/scriptlet/macro lines

def _parse_gbp_tag(self, linenum, lineobj):

Parse special git-buildpackage tags

def _parse_content(self):

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

def _delete_tag(self, tag, num):

Delete a tag

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

Set a tag value

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

Update a tag in spec file content

def _delete_special_macro(self, name, identifier):

Delete a special macro line in spec file content

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

Update a special macro line in spec file content

def _set_section(self, name, text):

Update/create a complete section in spec file.

def set_changelog(self, text):

Update or create the %changelog section

def get_changelog(self):

Get the %changelog section

def update_patches(self, patches, commands):

Update spec with new patch tags and patch macros

def patchseries(self, unapplied=False, ignored=False):

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

def _guess_orig_prefix(self, orig):

Guess prefix for the orig file

def _guess_orig_file(self):

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

API Documentation for git-buildpackage, generated by pydoctor at 2017-11-28 11:32:01.