From 5bf69e7162c44e5987f356cc647d98cbda0d0265 Mon Sep 17 00:00:00 2001 From: Tomas Mlcoch Date: Tue, 4 Mar 2014 10:27:53 +0100 Subject: [PATCH] createrepo_c: Support for changelog-limit = -1 (Dumps all changelogs) --- src/cmd_parser.c | 2 +- src/parsehdr.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cmd_parser.c b/src/cmd_parser.c index e5c0705..6b6f119 100644 --- a/src/cmd_parser.c +++ b/src/cmd_parser.c @@ -198,7 +198,7 @@ check_arguments(struct CmdOptions *options, } // Check changelog_limit - if ((options->changelog_limit < 0) || (options->changelog_limit > 100)) { + if ((options->changelog_limit < -1)) { g_warning("Wrong changelog limit \"%d\" - Using 10", options->changelog_limit); options->changelog_limit = DEFAULT_CHANGELOG_LIMIT; } diff --git a/src/parsehdr.c b/src/parsehdr.c index 9e3c017..9802d0f 100644 --- a/src/parsehdr.c +++ b/src/parsehdr.c @@ -470,7 +470,7 @@ cr_package_from_header(Header hdr, gint64 mtime, gint64 size, while ((rpmtdNext(changelogtimes) != -1) && (rpmtdNext(changelognames) != -1) && (rpmtdNext(changelogtexts) != -1) && - (changelog_limit > 0)) + (changelog_limit > 0 || changelog_limit == -1)) { gint64 time = rpmtdGetNumber(changelogtimes); @@ -495,7 +495,8 @@ cr_package_from_header(Header hdr, gint64 mtime, gint64 size, } pkg->changelogs = g_slist_prepend(pkg->changelogs, changelog); - changelog_limit--; + if (changelog_limit != -1) + changelog_limit--; // If a previous entry has the same time, increment time of the previous // entry by one. Ugly but works! -- 2.7.4