Package rpmUtils :: Module miscutils
[hide private]
[frames] | no frames]

Module miscutils

source code

Functions [hide private]
 
rpmOutToStr(arg) source code
 
compareEVR((e1, v1, r1), (e2, v2, r2)) source code
 
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
source code
 
getSigInfo(hdr)
checks signature from an hdr hand back signature information and/or an error code
source code
 
pkgTupleFromHeader(hdr)
return a pkgtuple (n, a, e, v, r) from a hdr object, converts None epoch to 0, as well.
source code
 
rangeCheck(reqtuple, pkgtuple)
returns true if the package epoch-ver-rel satisfy the range requested in the reqtuple: ex: foo >= 2.1-1
source code
 
rangeCompare(reqtuple, provtuple)
returns true if provtuple satisfies reqtuple
source code
 
unique(s)
Return a list of the elements in s, but without duplicates.
source code
 
splitFilename(filename)
Pass in a standard style rpm fullname
source code
 
rpm2cpio(fdno, out=sys.stderr, bufsize=2048)
Performs roughly the equivalent of rpm2cpio(8).
source code
 
formatRequire(name, version, flags) source code
 
flagToString(flags) source code
 
stringToVersion(verstring) source code
 
hdrFromPackage(ts, package)
hand back the rpm header or raise an Error if the pkg is fubar
source code
 
checkSignals() source code
Variables [hide private]
  __package__ = 'rpmUtils'
Function Details [hide private]

unique(s)

source code 

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.

splitFilename(filename)

source code 

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

rpm2cpio(fdno, out=sys.stderr, bufsize=2048)

source code 

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.