package documentation
provides some rpm source package related helpers
Module | changelog |
An RPM Changelog |
Module | git |
No module docstring; 1/1 class documented |
Module | lib |
Wrapper module for librpm |
Module | linkedlist |
Simple implementation of a doubly linked list |
Module | policy |
Default packaging policy for RPM |
From __init__.py
:
Class |
|
Upstream source class for RPM packages |
Class |
|
Class for parsing/modifying spec files |
Class |
|
Keeps all needed data read from a source rpm |
Exception |
|
Macro expansion in spec file failed |
Exception |
|
Spec file parsing error |
Function | compose |
Compose a full version string from individual "version components", i.e. epoch, version and release |
Function | filter |
Remove entry from the version dict |
Function | guess |
Guess a spec file |
Function | guess |
Guess spec file from a list of filenames |
Function | guess |
Try to find/parse the spec file from a given git treeish. |
Function | parse |
parse srpm by creating a SrcRpmFile object |
Function | spec |
Get and parse a spec file from a give Git treeish |
Function | split |
Parse full version string and split it into individual "version components", i.e. upstreamversion, epoch and release |
Function | string |
Convert string of possible unit identifier to int. |
Convert string of possible unit identifier to int.
Parameters | |
val | value to be converted |
Returns | |
int >>> string_to_int("1234") 1234 >>> string_to_int("123k") 125952 >>> string_to_int("1234K") 1263616 >>> string_to_int("1M") 1048576 | value as integer |
Parse full version string and split it into individual "version components", i.e. upstreamversion, epoch and release
Parameters | |
version:str | full version of a package |
Returns | |
dict >>> sorted(split_version_str("1").items()) [('epoch', None), ('release', None), ('upstreamversion', '1')] >>> sorted(split_version_str("1.2.3-5.3").items()) [('epoch', None), ('release', '5.3'), ('upstreamversion', '1.2.3')] >>> sorted(split_version_str("3:1.2.3").items()) [('epoch', '3'), ('release', None), ('upstreamversion', '1.2.3')] >>> sorted(split_version_str("3:1-0").items()) [('epoch', '3'), ('release', '0'), ('upstreamversion', '1')] | individual version components |
Compose a full version string from individual "version components", i.e. epoch, version and release
Parameters | |
evr:dict of str | dict of version components |
Returns | |
str >>> compose_version_str({'epoch': '', 'upstreamversion': '1.0'}) '1.0' >>> compose_version_str({'epoch': '2', 'upstreamversion': '1.0', 'release': None}) '2:1.0' >>> compose_version_str({'epoch': None, 'upstreamversion': '1', 'release': '0'}) '1-0' >>> compose_version_str({'epoch': '2', 'upstreamversion': '1.0', 'release': '2.3'}) '2:1.0-2.3' >>> compose_version_str({'epoch': '2', 'upstreamversion': '', 'release': '2.3'}) | full version |
Remove entry from the version dict
Parameters | |
evr:dict of str | dict of version components |
*keys:strs | keys to remove |
Returns | |
dict of str >>> sorted(list(filter_version({'epoch': 'foo', 'upstreamversion': 'bar', 'vendor': 'baz'}, 'vendor').keys())) ['epoch', 'upstreamversion'] >>> list(filter_version({'epoch': 'foo', 'upstreamversion': 'bar', 'revision': 'baz'}, 'epoch', 'revision').keys()) ['upstreamversion'] | new version dict |