diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-03-31 12:07:37 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-03-31 12:07:37 +0300 |
commit | dccc08ab66c044beaba806006302c88c42ad458e (patch) | |
tree | 45fd0e4411f637fa7d3f44fd575c4fc55ad41686 /lib/rpmlead.c | |
parent | 7ddab3ab8d55a6d763c823d4b3c090ccf53eb5a4 (diff) | |
download | librpm-tizen-dccc08ab66c044beaba806006302c88c42ad458e.tar.gz librpm-tizen-dccc08ab66c044beaba806006302c88c42ad458e.tar.bz2 librpm-tizen-dccc08ab66c044beaba806006302c88c42ad458e.zip |
Make rpmLeadCheck() return error msg instead of direct logging
- allows silent checking of lead and differentiating between
non-rpm files and incompatible rpms, avoiding bogus "not an rpm package"
message on manifests
Diffstat (limited to 'lib/rpmlead.c')
-rw-r--r-- | lib/rpmlead.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rpmlead.c b/lib/rpmlead.c index 7991774cc..0907becf7 100644 --- a/lib/rpmlead.c +++ b/lib/rpmlead.c @@ -94,18 +94,18 @@ rpmRC rpmLeadWrite(FD_t fd, rpmlead lead) return RPMRC_OK; } -rpmRC rpmLeadCheck(rpmlead lead, const char* fn) +rpmRC rpmLeadCheck(rpmlead lead, const char **msg) { if (memcmp(lead->magic, lead_magic, sizeof(lead_magic))) { - rpmlog(RPMLOG_ERR, _("%s: not an rpm package\n"), fn); + if (msg) *msg = _("not an rpm package"); return RPMRC_NOTFOUND; } if (lead->signature_type != RPMSIGTYPE_HEADERSIG) { - rpmlog(RPMLOG_ERR, _("%s: illegal signature type\n"), fn); + if (msg) *msg = _("illegal signature type"); return RPMRC_FAIL; } if (lead->major < 3 || lead->major > 4) { - rpmlog(RPMLOG_ERR, _("%s: unsupported RPM package (version %d)\n"), fn, lead->major); + if (msg) *msg = _("unsupported RPM package version"); return RPMRC_FAIL; } return RPMRC_OK; |