libpriv/rpm-util: Tweak changelog entry indentation
Indent the changelog entries so it's easier to tell which entries belong to which packages. Before: ``` $ ros db diff -c ostree diff commit old: rollback deployment (ef3c0e45ee1b874bc4952904a778084f0c32a0e06346e271786abf544dad54ff) ostree diff commit new: booted deployment (c1d4c3ef571a53e5ab3dbd6ea1ec91a374ebd5f6ba9c0a99938d0649853588a5) Upgraded: firefox 63.0.3-1.fc29.x86_64 -> 63.0.3-2.fc29.x86_64 * Wed Nov 21 2018 Martin Stransky <stransky@redhat.com> - 63.0.3-2 - Fixed mozbz#1507475 - crash when display changes (rhbz#1646151). httpd 2.4.37-3.fc29.x86_64 -> 2.4.37-5.fc29.x86_64 * Fri Nov 23 2018 Lubos Uhliarik <luhliari@redhat.com> - 2.4.37-5 - Resolves: #1652678 - TLS connection allowed while all protocols are forbidden * Thu Nov 08 2018 Joe Orton <jorton@redhat.com> - 2.4.37-4 - add httpd.conf(5) (#1611361) ``` After: ``` $ ros db diff -c ostree diff commit old: rollback deployment (ef3c0e45ee1b874bc4952904a778084f0c32a0e06346e271786abf544dad54ff) ostree diff commit new: booted deployment (c1d4c3ef571a53e5ab3dbd6ea1ec91a374ebd5f6ba9c0a99938d0649853588a5) Upgraded: firefox 63.0.3-1.fc29.x86_64 -> 63.0.3-2.fc29.x86_64 * Wed Nov 21 2018 Martin Stransky <stransky@redhat.com> - 63.0.3-2 - Fixed mozbz#1507475 - crash when display changes (rhbz#1646151). httpd 2.4.37-3.fc29.x86_64 -> 2.4.37-5.fc29.x86_64 * Fri Nov 23 2018 Lubos Uhliarik <luhliari@redhat.com> - 2.4.37-5 - Resolves: #1652678 - TLS connection allowed while all protocols are forbidden * Thu Nov 08 2018 Joe Orton <jorton@redhat.com> - 2.4.37-4 - add httpd.conf(5) (#1611361) ``` Closes: #1687 Approved by: rfairley
This commit is contained in:
parent
0e8eab7bfc
commit
01c349a558
@ -593,13 +593,25 @@ rpmhdrs_diff_prnt_block (gboolean changelogs, struct RpmHeadersDiff *diff)
|
||||
g_str_equal (ochange_text, nchange_text))
|
||||
break;
|
||||
|
||||
#define CHANGELOG_INDENTATION " "
|
||||
|
||||
g_autofree char *indented_nchange_text = NULL;
|
||||
if (strchr (nchange_text, '\n'))
|
||||
{
|
||||
g_auto(GStrv) lines = g_strsplit (nchange_text, "\n", 0);
|
||||
indented_nchange_text = g_strjoinv ("\n" CHANGELOG_INDENTATION, lines);
|
||||
}
|
||||
|
||||
/* Otherwise, print. */
|
||||
dt = g_date_time_new_from_unix_utc (nchange_date);
|
||||
date_time_str = g_date_time_format (dt, "%a %b %d %Y");
|
||||
g_date_time_unref (dt);
|
||||
|
||||
g_print ("* %s %s\n%s\n\n", date_time_str, nchange_name,
|
||||
nchange_text);
|
||||
g_print (CHANGELOG_INDENTATION "* %s %s\n"
|
||||
CHANGELOG_INDENTATION "%s\n\n", date_time_str, nchange_name,
|
||||
indented_nchange_text ?: nchange_text);
|
||||
|
||||
#undef CHANGELOG_INDENTATION
|
||||
|
||||
--ncnum;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user