rpmUtils.miscutils

rpmUtils.miscutils.rpmOutToStr(arg)
rpmUtils.miscutils.compareEVR((e1, v1, r1), (e2, v2, r2))
rpmUtils.miscutils.compareVerOnly(v1, v2)

compare version strings only using rpm vercmp

rpmUtils.miscutils.checkSig(ts, package)

Takes a transaction set and a package, check it’s sigs, return 0 if they are all fine return 1 if the gpg key can’t be found return 2 if the header is in someway damaged return 3 if the key is not trusted return 4 if the pkg is not gpg or pgp signed

rpmUtils.miscutils.getSigInfo(hdr)

checks signature from an hdr hand back signature information and/or an error code

rpmUtils.miscutils.pkgTupleFromHeader(hdr)

return a pkgtuple (n, a, e, v, r) from a hdr object, converts None epoch to 0, as well.

rpmUtils.miscutils.rangeCheck(reqtuple, pkgtuple)

returns true if the package epoch-ver-rel satisfy the range requested in the reqtuple: ex: foo >= 2.1-1

rpmUtils.miscutils.rangeCompare(reqtuple, provtuple)

returns true if provtuple satisfies reqtuple

rpmUtils.miscutils.unique(s)

Return a list of the elements in s, but without duplicates.

For example, unique([1,2,3,1,2,3]) is some permutation of [1,2,3], unique(“abcabc”) some permutation of [“a”, “b”, “c”], and unique(([1, 2], [2, 3], [1, 2])) some permutation of [[2, 3], [1, 2]].

For best speed, all sequence elements should be hashable. Then unique() will usually work in linear time.

If not possible, the sequence elements should enjoy a total ordering, and if list(s).sort() doesn’t raise TypeError it’s assumed that they do enjoy a total ordering. Then unique() will usually work in O(N*log2(N)) time.

If that’s not possible either, the sequence elements must support equality-testing. Then unique() will usually work in quadratic time.

rpmUtils.miscutils.splitFilename(filename)

Pass in a standard style rpm fullname

Return a name, version, release, epoch, arch, e.g.::
foo-1.0-1.i386.rpm returns foo, 1.0, 1, i386 1:bar-9-123a.ia64.rpm returns bar, 9, 123a, 1, ia64
rpmUtils.miscutils.rpm2cpio(fdno, out=<open file '<stdout>', mode 'w' at 0x7fd716efa1e0>, bufsize=2048)

Performs roughly the equivalent of rpm2cpio(8). Reads the package from fdno, and dumps the cpio payload to out, using bufsize as the buffer size.

rpmUtils.miscutils.formatRequire(name, version, flags)

Return a human readable requirement string (ex. foobar >= 2.0) @param name: requirement name (ex. foobar) @param version: requirent version (ex. 2.0) @param flags: binary flags ( 0010 = equal, 0100 = greater than, 1000 = less than )

rpmUtils.miscutils.flagToString(flags)
rpmUtils.miscutils.stringToVersion(verstring)
rpmUtils.miscutils.hdrFromPackage(ts, package)

hand back the rpm header or raise an Error if the pkg is fubar

rpmUtils.miscutils.checkSignals()

Previous topic

rpmUtils.arch

Next topic

rpmUtils.oldUtils

This Page