From e6f346ead484dd37ff28498b2e6cdfd706bf0b4c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 17 Feb 2017 12:12:37 -0500 Subject: [PATCH] Don't nerf "rpmspec --eval '%trace' -P foo.spec" output with ellipses. The whole point of %trace is that some macro is being evaluated in a surprising way, and you want to know what it is. This is often the result of an unfortunately complex macro with difficult to see intermediate results. Shortening the output because it doesn't fit past 61 or so characters does not help, and we have big screens these days. Don't do it. Signed-off-by: Peter Jones --- rpmio/macro.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/rpmio/macro.c b/rpmio/macro.c index ec7b4f82a..937754710 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -278,8 +278,6 @@ static void printMacro(MacroBuf mb, const char * s, const char * se) { const char *senl; - const char *ellipsis; - int choplen; if (s >= se) { /* XXX just in case */ fprintf(stderr, _("%3d>%*s(empty)"), mb->depth, @@ -294,19 +292,11 @@ printMacro(MacroBuf mb, const char * s, const char * se) for (senl = se; *senl && !iseol(*senl); senl++) {}; - /* Limit trailing non-trace output */ - choplen = 61 - (2 * mb->depth); - if ((senl - s) > choplen) { - senl = s + choplen; - ellipsis = "..."; - } else - ellipsis = ""; - /* Substitute caret at end-of-macro position */ fprintf(stderr, "%3d>%*s%%%.*s^", mb->depth, (2 * mb->depth + 1), "", (int)(se - s), s); if (se[0] != '\0' && se[1] != '\0' && (senl - (se+1)) > 0) - fprintf(stderr, "%-.*s%s", (int)(senl - (se+1)), se+1, ellipsis); + fprintf(stderr, "%-.*s", (int)(senl - (se+1)), se+1); fprintf(stderr, "\n"); } @@ -319,9 +309,6 @@ printMacro(MacroBuf mb, const char * s, const char * se) static void printExpansion(MacroBuf mb, const char * t, const char * te) { - const char *ellipsis; - int choplen; - if (!(te > t)) { rpmlog(RPMLOG_DEBUG, _("%3d<%*s(empty)\n"), mb->depth, (2 * mb->depth + 1), ""); return; @@ -330,7 +317,6 @@ printExpansion(MacroBuf mb, const char * t, const char * te) /* Shorten output which contains newlines */ while (te > t && iseol(te[-1])) te--; - ellipsis = ""; if (mb->depth > 0) { const char *tenl; @@ -338,17 +324,11 @@ printExpansion(MacroBuf mb, const char * t, const char * te) while ((tenl = strchr(t, '\n')) && tenl < te) t = ++tenl; - /* Limit expand output */ - choplen = 61 - (2 * mb->depth); - if ((te - t) > choplen) { - te = t + choplen; - ellipsis = "..."; - } } rpmlog(RPMLOG_DEBUG,"%3d<%*s", mb->depth, (2 * mb->depth + 1), ""); if (te > t) - rpmlog(RPMLOG_DEBUG, "%.*s%s", (int)(te - t), t, ellipsis); + rpmlog(RPMLOG_DEBUG, "%.*s", (int)(te - t), t); rpmlog(RPMLOG_DEBUG, "\n"); }