Take advantage of Fdescr() in rpmReadPackageFile()
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 7 Jul 2011 14:26:56 +0000 (17:26 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 7 Jul 2011 14:26:56 +0000 (17:26 +0300)
- If fn to rpmReadPackageFile() is NULL, use Fdescr() value to give
  more meaningful errors
- Change a couple of places where we haven't got a clue of the file
  name to take advantage of the above

lib/package.c
lib/psm.c
python/rpmts-py.c

index c892bab..16817f4 100644 (file)
@@ -557,6 +557,8 @@ static rpmRC rpmpkgRead(rpmKeyring keyring, rpmVSFlags vsflags,
     DIGEST_CTX ctx = NULL;
 
     if (hdrp) *hdrp = NULL;
+    if (fn == NULL)
+       fn = Fdescr(fd);
 
     rpmtdReset(&sigtd);
 
index f91cd72..34809d6 100644 (file)
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -235,7 +235,7 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
     struct rpmtd_s filenames;
 
     rpmtdReset(&filenames);
-    rpmrc = rpmReadPackageFile(ts, fd, RPMDBG_M("InstallSourcePackage"), &h);
+    rpmrc = rpmReadPackageFile(ts, fd, NULL, &h);
     switch (rpmrc) {
     case RPMRC_NOTTRUSTED:
     case RPMRC_NOKEY:
index cabea1c..0a55417 100644 (file)
@@ -349,7 +349,7 @@ rpmts_HdrFromFdno(rpmtsObject * s, PyObject *arg)
        return NULL;
 
     Py_BEGIN_ALLOW_THREADS;
-    rpmrc = rpmReadPackageFile(s->ts, rpmfdGetFd(fdo), "rpmts_HdrFromFdno", &h);
+    rpmrc = rpmReadPackageFile(s->ts, rpmfdGetFd(fdo), NULL, &h);
     Py_END_ALLOW_THREADS;
     Py_XDECREF(fdo);