Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | From 989e425d416474c191b020d0825895e3df4bd033 Mon Sep 17 00:00:00 2001 |
| 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> |
| 12 | --- |
| 13 | lib/rpmscript.c | 8 ++++---- |
| 14 | 1 file changed, 4 insertions(+), 4 deletions(-) |
| 15 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 16 | Index: git/lib/rpmscript.c |
| 17 | =================================================================== |
| 18 | --- git.orig/lib/rpmscript.c |
| 19 | +++ git/lib/rpmscript.c |
| 20 | @@ -270,7 +270,7 @@ static char * writeScript(const char *cm |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 21 | if (Ferror(fd)) |
| 22 | goto exit; |
| 23 | |
| 24 | - if (rpmIsDebug() && (rstreq(cmd, "/bin/sh") || rstreq(cmd, "/bin/bash"))) { |
| 25 | + if (rpmIsVerbose() && (rstreq(cmd, "/bin/sh") || rstreq(cmd, "/bin/bash"))) { |
| 26 | static const char set_x[] = "set -x\n"; |
| 27 | /* Assume failures will be caught by the write below */ |
| 28 | Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd); |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 29 | @@ -302,7 +302,7 @@ static rpmRC runExtScript(rpmPlugins plu |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 30 | char *mline = NULL; |
| 31 | rpmRC rc = RPMRC_FAIL; |
| 32 | |
| 33 | - rpmlog(RPMLOG_DEBUG, "%s: scriptlet start\n", sname); |
| 34 | + rpmlog(RPMLOG_INFO, "%s: scriptlet start\n", sname); |
| 35 | |
| 36 | if (script) { |
| 37 | fn = writeScript(*argvp[0], script); |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 38 | @@ -354,7 +354,7 @@ static rpmRC runExtScript(rpmPlugins plu |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 39 | sname, strerror(errno)); |
| 40 | goto exit; |
| 41 | } else if (pid == 0) {/* Child */ |
| 42 | - rpmlog(RPMLOG_DEBUG, "%s: execv(%s) pid %d\n", |
| 43 | + rpmlog(RPMLOG_INFO, "%s: execv(%s) pid %d\n", |
| 44 | sname, *argvp[0], (unsigned)getpid()); |
| 45 | |
| 46 | fclose(in); |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 47 | @@ -397,7 +397,7 @@ static rpmRC runExtScript(rpmPlugins plu |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 48 | reaped = waitpid(pid, &status, 0); |
| 49 | } while (reaped == -1 && errno == EINTR); |
| 50 | |
| 51 | - rpmlog(RPMLOG_DEBUG, "%s: waitpid(%d) rc %d status %x\n", |
| 52 | + rpmlog(RPMLOG_INFO, "%s: waitpid(%d) rc %d status %x\n", |
| 53 | sname, (unsigned)pid, (unsigned)reaped, status); |
| 54 | |
| 55 | if (reaped < 0) { |