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:33 +0100 |
commit | a460b04789f48475c9ccf921c0e99a78c7fecdd0 (patch) | |
tree | 6e8c80ab38323ad9e4af4a7f0e6aa389732a41da /meta | |
parent | a43991d5309afc9bdfd700ed720eccf5807acead (diff) | |
download | poky-a460b04789f48475c9ccf921c0e99a78c7fecdd0.tar.gz |
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]
(From OE-Core rev: aba432ea3ada509b24075c159081e8f0f942c308)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 @@ | |||
1 | rpmdb: more verbose error logging in rpmTempFile() | ||
2 | |||
3 | Upstream-Status: Inappropriate [debugging] | ||
4 | |||
5 | Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> | ||
6 | |||
7 | diff --git a/rpmdb/signature.c b/rpmdb/signature.c | ||
8 | index dce6c4e..a1d0f06 100644 | ||
9 | --- a/rpmdb/signature.c | ||
10 | +++ b/rpmdb/signature.c | ||
11 | @@ -37,6 +37,7 @@ int rpmTempFile(const char * prefix, const char ** fnptr, void * fdptr) | ||
12 | int temput; | ||
13 | FD_t fd = NULL; | ||
14 | unsigned int ran; | ||
15 | + int ret = 0; | ||
16 | |||
17 | if (!prefix) prefix = ""; | ||
18 | |||
19 | @@ -44,8 +45,11 @@ int rpmTempFile(const char * prefix, const char ** fnptr, void * fdptr) | ||
20 | if (!_initialized) { | ||
21 | _initialized = 1; | ||
22 | tempfn = rpmGenPath(prefix, tpmacro, NULL); | ||
23 | - if (rpmioMkpath(tempfn, 0755, (uid_t) -1, (gid_t) -1)) | ||
24 | - goto errxit; | ||
25 | + ret = rpmioMkpath(tempfn, 0755, (uid_t) -1, (gid_t) -1); | ||
26 | + if (ret) { | ||
27 | + rpmlog(RPMLOG_ERR, _("error creating temporary directory %s: %d\n"), tempfn, ret); | ||
28 | + goto errxit; | ||
29 | + } | ||
30 | } | ||
31 | |||
32 | /* XXX should probably use mkstemp here */ | ||
33 | @@ -68,12 +72,16 @@ int rpmTempFile(const char * prefix, const char ** fnptr, void * fdptr) | ||
34 | #endif | ||
35 | |||
36 | temput = urlPath(tempfn, &tfn); | ||
37 | - if (*tfn == '\0') goto errxit; | ||
38 | + if (*tfn == '\0') { | ||
39 | + rpmlog(RPMLOG_ERR, _("error creating tempfile: empty filename\n")); | ||
40 | + goto errxit; | ||
41 | + } | ||
42 | |||
43 | switch (temput) { | ||
44 | case URL_IS_DASH: | ||
45 | case URL_IS_HKP: | ||
46 | case URL_IS_MONGO: /* XXX FIXME */ | ||
47 | + rpmlog(RPMLOG_ERR, _("error creating temporary file, invalid uri type: %d\n"), temput); | ||
48 | goto errxit; | ||
49 | /*@notreached@*/ /*@switchbreak@*/ break; | ||
50 | case URL_IS_HTTPS: | ||
51 | -- | ||
52 | 2.6.6 | ||
53 | |||
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 += " \ | |||
150 | file://rpm-rpmdb-grammar.patch \ | 150 | file://rpm-rpmdb-grammar.patch \ |
151 | file://rpm-disable-blaketest.patch \ | 151 | file://rpm-disable-blaketest.patch \ |
152 | file://rpm-autogen-force.patch \ | 152 | file://rpm-autogen-force.patch \ |
153 | file://rpmdb-more-verbose-error-logging-in-rpmTempFile.patch \ | ||
153 | " | 154 | " |
154 | 155 | ||
155 | SRC_URI_append_libc-musl = "\ | 156 | SRC_URI_append_libc-musl = "\ |