kojismokydingo.rpm¶
Koji Smoky Dingo - RPM NEVRA Utils
- author:
Christopher O'Brien <obriencj@gmail.com>
- license:
GPL v3
- evr_compare(left_evr, right_evr)[source]¶
Compare two (Epoch, Version, Release) tuples.
This is an alternative implementation of the rpm lib's labelCompare function.
Return values:
1 if left_evr is greater-than right_evr
0 if left_evr is equal-to right_evr
-1 if left_evr is less-than right_evr
- evr_split(evr)[source]¶
Splits an EVR into a dict with the keys epoch, version, and release.
If epoch is omitted, it is presumed to be
"0"
If release is omitted, it is presumed to beNone
Valid RPM EVR is in the following layout:
eg.
"32:9.10.2-2.P1.fc22"
epoch:
"32"
version:
"9.10.2"
release:
"2.P1.fc22"
- nevr_split(nevr)[source]¶
Splits an NEVR into a four-tuple represending the name, epoch, version, and release.
If name, epoch, or release are absent they are represented as
None
This differs from NEVRA splitting in that the last dotted segment of the release is not considered an architecture. Because there may be 1 or more dotted segments to a release, it's impossible to determine whether the final segment is an arch or not simply from the structure.
Valid RPM NEVRA is in the following layout:
eg.
"bind-32:9.10.2-2.P1.fc22"
name:
"bind"
epoch:
"32"
version:
"9.10.2"
release:
"2.P1.fc22"
- nevra_split(nevra)[source]¶
Splits an NEVRA into a five-tuple representing the name, epoch, version, release, and arch.
If name, epoch, arch, or release are absent, they are represented as a
None
This differs from NEVRA splitting in that the last dotted segment of the release is considered to be the architecture. Because there may be 1 or more dotted segments to a release, it's impossible to determine whether the final segment is an arch or not simply from the structure. However, a valid NEVRA will always have at least two segments -- the last will be the architecture.
Valid RPM NEVRA is in the following layout:
eg.
"bind-32:9.10.2-2.P1.fc22.x86_64"
name:
"bind"
epoch:
"32"
version:
"9.10.2"
release:
"2.P1.fc22"
arch:
"x86_64"