diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-04-13 17:40:04 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-04-14 10:58:27 +0100 |
commit | aba432ea3ada509b24075c159081e8f0f942c308 (patch) | |
tree | 3e99c4f60ed9c93f61d36ac7727531aca9f238a7 /meta | |
parent | 018e3f9f215607a1d7c9fb7780236cc467f3103b (diff) | |
download | openembedded-core-aba432ea3ada509b24075c159081e8f0f942c308.tar.gz openembedded-core-aba432ea3ada509b24075c159081e8f0f942c308.tar.bz2 openembedded-core-aba432ea3ada509b24075c159081e8f0f942c308.zip |
rpm: more verbose errors in rpmTempFile
This patch adds better error logging inside the rpm tempfile function in
order to be able to better analyze a rare and very hard-to-reproduce
failure in oe-selftest for rpm signing.
[YOCTO #9416]
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/rpm/rpm/rpmdb-more-verbose-error-logging-in-rpmTempFile.patch | 53 | ||||
-rw-r--r-- | meta/recipes-devtools/rpm/rpm_5.4.16.bb | 1 |
2 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/rpm/rpmdb-more-verbose-error-logging-in-rpmTempFile.patch b/meta/recipes-devtools/rpm/rpm/rpmdb-more-verbose-error-logging-in-rpmTempFile.patch new file mode 100644 index 0000000000..809e54e9cb --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpmdb-more-verbose-error-logging-in-rpmTempFile.patch @@ -0,0 +1,53 @@ +rpmdb: more verbose error logging in rpmTempFile() + +Upstream-Status: Inappropriate [debugging] + +Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> + +diff --git a/rpmdb/signature.c b/rpmdb/signature.c +index dce6c4e..a1d0f06 100644 +--- a/rpmdb/signature.c ++++ b/rpmdb/signature.c +@@ -37,6 +37,7 @@ int rpmTempFile(const char * prefix, const char ** fnptr, void * fdptr) + int temput; + FD_t fd = NULL; + unsigned int ran; ++ int ret = 0; + + if (!prefix) prefix = ""; + +@@ -44,8 +45,11 @@ int rpmTempFile(const char * prefix, const char ** fnptr, void * fdptr) + if (!_initialized) { + _initialized = 1; + tempfn = rpmGenPath(prefix, tpmacro, NULL); +- if (rpmioMkpath(tempfn, 0755, (uid_t) -1, (gid_t) -1)) +- goto errxit; ++ ret = rpmioMkpath(tempfn, 0755, (uid_t) -1, (gid_t) -1); ++ if (ret) { ++ rpmlog(RPMLOG_ERR, _("error creating temporary directory %s: %d\n"), tempfn, ret); ++ goto errxit; ++ } + } + + /* XXX should probably use mkstemp here */ +@@ -68,12 +72,16 @@ int rpmTempFile(const char * prefix, const char ** fnptr, void * fdptr) + #endif + + temput = urlPath(tempfn, &tfn); +- if (*tfn == '\0') goto errxit; ++ if (*tfn == '\0') { ++ rpmlog(RPMLOG_ERR, _("error creating tempfile: empty filename\n")); ++ goto errxit; ++ } + + switch (temput) { + case URL_IS_DASH: + case URL_IS_HKP: + case URL_IS_MONGO: /* XXX FIXME */ ++ rpmlog(RPMLOG_ERR, _("error creating temporary file, invalid uri type: %d\n"), temput); + goto errxit; + /*@notreached@*/ /*@switchbreak@*/ break; + case URL_IS_HTTPS: +-- +2.6.6 + diff --git a/meta/recipes-devtools/rpm/rpm_5.4.16.bb b/meta/recipes-devtools/rpm/rpm_5.4.16.bb index d42724c212..9e2229a082 100644 --- a/meta/recipes-devtools/rpm/rpm_5.4.16.bb +++ b/meta/recipes-devtools/rpm/rpm_5.4.16.bb @@ -150,6 +150,7 @@ SRC_URI += " \ file://rpm-rpmdb-grammar.patch \ file://rpm-disable-blaketest.patch \ file://rpm-autogen-force.patch \ + file://rpmdb-more-verbose-error-logging-in-rpmTempFile.patch \ " SRC_URI_append_libc-musl = "\ |