diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2011-10-06 15:16:47 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2011-10-06 15:28:33 +0300 |
commit | 90a6c2b944f824c1e21b62a4b3771545529bdb8e (patch) | |
tree | a70cbfca4c24d42c11d90e9fccde756b36edee1e | |
parent | 1de7539ea8b7febadd0d31b5be049dcdd7179e4a (diff) | |
download | librpm-tizen-90a6c2b944f824c1e21b62a4b3771545529bdb8e.tar.gz librpm-tizen-90a6c2b944f824c1e21b62a4b3771545529bdb8e.tar.bz2 librpm-tizen-90a6c2b944f824c1e21b62a4b3771545529bdb8e.zip |
Eliminate headerCheckPayloadFormat() from the API
- While we're on API killing spree... Exporting this was needless and
dumb to begin with (greetings to self in 2007...), bury it inside
depends.c as static and let rot there.
- Might be a better idea to kill it completely with some other
mechanism such as turning payload format into rpmlib() dependency
internally but just get it out of public sight for now.
-rw-r--r-- | lib/depends.c | 31 | ||||
-rw-r--r-- | lib/package.c | 30 | ||||
-rw-r--r-- | lib/rpmlib.h | 7 |
3 files changed, 31 insertions, 37 deletions
diff --git a/lib/depends.c b/lib/depends.c index 4db55d208..24ae7a5d4 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -50,6 +50,37 @@ static rpmds rpmlibP = NULL; #undef HASHKEYTYPE /** + * Check for supported payload format in header. + * @param h header to check + * @return RPMRC_OK if supported, RPMRC_FAIL otherwise + */ +static rpmRC headerCheckPayloadFormat(Header h) { + rpmRC rc = RPMRC_OK; + const char *payloadfmt = headerGetString(h, RPMTAG_PAYLOADFORMAT); + /* + * XXX Ugh, rpm 3.x packages don't have payload format tag. Instead + * of blindly allowing, should check somehow (HDRID existence or... ?) + */ + if (!payloadfmt) return rc; + + if (!rstreq(payloadfmt, "cpio")) { + char *nevra = headerGetAsString(h, RPMTAG_NEVRA); + if (payloadfmt && rstreq(payloadfmt, "drpm")) { + rpmlog(RPMLOG_ERR, + _("%s is a Delta RPM and cannot be directly installed\n"), + nevra); + } else { + rpmlog(RPMLOG_ERR, + _("Unsupported payload (%s) in package %s\n"), + payloadfmt ? payloadfmt : "none", nevra); + } + free(nevra); + rc = RPMRC_FAIL; + } + return rc; +} + +/** * Add removed package instance to ordered transaction set. * @param ts transaction set * @param h header diff --git a/lib/package.c b/lib/package.c index dc957efb7..a65a61a01 100644 --- a/lib/package.c +++ b/lib/package.c @@ -715,35 +715,5 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp) return rc; } -/** - * Check for supported payload format in header. - * @param h header to check - * @return RPMRC_OK if supported, RPMRC_FAIL otherwise - */ -rpmRC headerCheckPayloadFormat(Header h) { - rpmRC rc = RPMRC_OK; - const char *payloadfmt = headerGetString(h, RPMTAG_PAYLOADFORMAT); - /* - * XXX Ugh, rpm 3.x packages don't have payload format tag. Instead - * of blinly allowing, should check somehow (HDRID existence or... ?) - */ - if (!payloadfmt) return rc; - - if (!rstreq(payloadfmt, "cpio")) { - char *nevra = headerGetAsString(h, RPMTAG_NEVRA); - if (payloadfmt && rstreq(payloadfmt, "drpm")) { - rpmlog(RPMLOG_ERR, - _("%s is a Delta RPM and cannot be directly installed\n"), - nevra); - } else { - rpmlog(RPMLOG_ERR, - _("Unsupported payload (%s) in package %s\n"), - payloadfmt ? payloadfmt : "none", nevra); - } - free(nevra); - rc = RPMRC_FAIL; - } - return rc; -} diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 5a0485e8e..e793ec6c7 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -122,13 +122,6 @@ void rpmFreeRpmrc(void); */ int rpmVersionCompare(Header first, Header second); -/** \ingroup header - * Check for supported payload format in header. - * @param h header to check - * @return RPMRC_OK if supported, RPMRC_FAIL otherwise - */ -rpmRC headerCheckPayloadFormat(Header h); - /** \ingroup header * Check header consistency, performing headerGetEntry() the hard way. * |