rpmfiFDigestHex() instead of manual hex conversion

- showQueryPackage() and python rpmfi_Digest() at least..
This commit is contained in:
Panu Matilainen 2008-05-30 12:28:29 +03:00
parent 29bdb49f16
commit b9c69d1bab
2 changed files with 4 additions and 9 deletions

View File

@ -195,12 +195,9 @@ int showQueryPackage(QVA_t qva, rpmts ts, Header h)
if (qva->qva_flags & QUERY_FOR_DUMPFILES) {
char *add, *fdigest;
size_t diglen = 0;
const unsigned char *digest = rpmfiFDigest(fi, NULL, &diglen);
fdigest = pgpHexStr(digest, diglen);
fdigest = rpmfiFDigestHex(fi, NULL);
rasprintf(&add, "%s %d %d %s 0%o ",
fn, (int)fsize, fmtime, fdigest, fmode);
fn, (int)fsize, fmtime, fdigest ? fdigest : "", fmode);
rstrcat(&buf, add);
free(add);
free(fdigest);

View File

@ -96,12 +96,10 @@ static PyObject *
rpmfi_Digest(rpmfiObject * s)
{
const unsigned char *digest;
size_t diglen = 0;
digest = rpmfiFDigest(s->fi, NULL, &diglen);
digest = rpmfiFDigestHex(s->fi, NULL);
if (digest) {
char *dig = pgpHexStr(digest, diglen);
return Py_BuildValue("s", dig);
return Py_BuildValue("s", digest);
} else {
Py_RETURN_NONE;
}