diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-06-05 12:43:53 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-06-05 12:43:53 +0300 |
commit | 592a1e5998c9b3646987e494de481a413473dd10 (patch) | |
tree | 87a78180d82455b9500af00b27c47230c59f01f5 | |
parent | 086dac456e607d61d0c2e31f80d29797c7ec4e50 (diff) | |
download | librpm-tizen-592a1e5998c9b3646987e494de481a413473dd10.tar.gz librpm-tizen-592a1e5998c9b3646987e494de481a413473dd10.tar.bz2 librpm-tizen-592a1e5998c9b3646987e494de481a413473dd10.zip |
Payload compatibility checking fixes.
Only check for payload compatibility when dealing with packages (and not
eg build headers). Don't crash if no payload format defined in header.
-rw-r--r-- | lib/depends.c | 4 | ||||
-rw-r--r-- | lib/package.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/depends.c b/lib/depends.c index 1b3c1df04..dfffa9a03 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -158,8 +158,8 @@ int rpmtsAddInstallElement(rpmts ts, Header h, hcolor = hGetColor(h); pkgKey = RPMAL_NOMATCH; - /* Check for supported payload format */ - if (headerCheckPayload(h) != RPMRC_OK) { + /* Check for supported payload format if it's a package */ + if (key && headerCheckPayload(h) != RPMRC_OK) { ec = 1; goto exit; } diff --git a/lib/package.c b/lib/package.c index f2354589f..db9cf56be 100644 --- a/lib/package.c +++ b/lib/package.c @@ -1081,14 +1081,14 @@ rpmRC headerCheckPayload(Header h) { rc = RPMRC_OK; } else { const char *nevra = hGetNEVRA(h, NULL); - if (strncmp(payloadfmt, "drpm", strlen("drpm")) == 0) { + if (payloadfmt && strncmp(payloadfmt, "drpm", strlen("drpm")) == 0) { rpmMessage(RPMMESS_ERROR, _("%s is a Delta RPM and cannot be directly installed\n"), nevra); } else { rpmMessage(RPMMESS_ERROR, _("Unsupported payload (%s) in package %s\n"), - payloadfmt, nevra); + payloadfmt ? payloadfmt : "none", nevra); } nevra = _free(nevra); } |