Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 1 | From 0005ab544230020e854e9709b2bc0501702c2968 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
| 3 | Date: Thu, 10 Jan 2019 18:14:18 +0100 |
| 4 | Subject: [PATCH] rpmscript.c: change logging level around scriptlets to INFO |
| 5 | from DEBUG |
| 6 | |
| 7 | That way we can debug scriptlet failures without writing lots of |
| 8 | irrelevant noise to rootfs logs. |
| 9 | |
| 10 | Upstream-Status: Inappropriate [oe-core specific] |
| 11 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 12 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 13 | --- |
| 14 | lib/rpmscript.c | 8 ++++---- |
| 15 | 1 file changed, 4 insertions(+), 4 deletions(-) |
| 16 | |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 17 | diff --git a/lib/rpmscript.c b/lib/rpmscript.c |
| 18 | index 37ada014c..bab0c97a6 100644 |
| 19 | --- a/lib/rpmscript.c |
| 20 | +++ b/lib/rpmscript.c |
| 21 | @@ -291,7 +291,7 @@ static char * writeScript(const char *cmd, const char *script) |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 22 | if (Ferror(fd)) |
| 23 | goto exit; |
| 24 | |
| 25 | - if (rpmIsDebug() && (rstreq(cmd, "/bin/sh") || rstreq(cmd, "/bin/bash"))) { |
| 26 | + if (rpmIsVerbose() && (rstreq(cmd, "/bin/sh") || rstreq(cmd, "/bin/bash"))) { |
| 27 | static const char set_x[] = "set -x\n"; |
| 28 | /* Assume failures will be caught by the write below */ |
| 29 | Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd); |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 30 | @@ -323,7 +323,7 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes, |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 31 | char *mline = NULL; |
| 32 | rpmRC rc = RPMRC_FAIL; |
| 33 | |
| 34 | - rpmlog(RPMLOG_DEBUG, "%s: scriptlet start\n", sname); |
| 35 | + rpmlog(RPMLOG_INFO, "%s: scriptlet start\n", sname); |
| 36 | |
| 37 | if (script) { |
| 38 | fn = writeScript(*argvp[0], script); |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 39 | @@ -375,7 +375,7 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes, |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 40 | sname, strerror(errno)); |
| 41 | goto exit; |
| 42 | } else if (pid == 0) {/* Child */ |
| 43 | - rpmlog(RPMLOG_DEBUG, "%s: execv(%s) pid %d\n", |
| 44 | + rpmlog(RPMLOG_INFO, "%s: execv(%s) pid %d\n", |
| 45 | sname, *argvp[0], (unsigned)getpid()); |
| 46 | |
| 47 | fclose(in); |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 48 | @@ -418,7 +418,7 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes, |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 49 | reaped = waitpid(pid, &status, 0); |
| 50 | } while (reaped == -1 && errno == EINTR); |
| 51 | |
| 52 | - rpmlog(RPMLOG_DEBUG, "%s: waitpid(%d) rc %d status %x\n", |
| 53 | + rpmlog(RPMLOG_INFO, "%s: waitpid(%d) rc %d status %x\n", |
| 54 | sname, (unsigned)pid, (unsigned)reaped, status); |
| 55 | |
| 56 | if (reaped < 0) { |