summaryrefslogtreecommitdiff
path: root/tools/rpmdb2solv.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/rpmdb2solv.c')
-rw-r--r--tools/rpmdb2solv.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/rpmdb2solv.c b/tools/rpmdb2solv.c
index aa978d8..9fa8580 100644
--- a/tools/rpmdb2solv.c
+++ b/tools/rpmdb2solv.c
@@ -41,12 +41,14 @@ static void
usage(int status)
{
fprintf(stderr, "\nUsage:\n"
- "rpmdb2solv [-n] [-b <basefile>] [-p <productsdir>] [-r <root>]\n"
+ "rpmdb2solv [-P] [-C] [-n] [-b <basefile>] [-p <productsdir>] [-r <root>]\n"
" -n : No packages, do not read rpmdb, useful to only parse products\n"
" -b <basefile> : Write .solv to <basefile>.solv instead of stdout\n"
" -p <productsdir> : Scan <productsdir> for .prod files, representing installed products\n"
" -r <root> : Prefix rpmdb path and <productsdir> with <root>\n"
" -o <solv> : Write .solv to file instead of stdout\n"
+ " -P : print percentage done\n"
+ " -C : include the changelog\n"
);
exit(status);
}
@@ -61,6 +63,7 @@ main(int argc, char **argv)
Repodata *data;
int c, percent = 0;
int nopacks = 0;
+ int add_changelog = 0;
const char *root = 0;
const char *basefile = 0;
const char *refname = 0;
@@ -82,7 +85,7 @@ main(int argc, char **argv)
* parse arguments
*/
- while ((c = getopt(argc, argv, "APhnkxXb:r:p:o:")) >= 0)
+ while ((c = getopt(argc, argv, "ACPhnkxXb:r:p:o:")) >= 0)
switch (c)
{
case 'h':
@@ -126,6 +129,9 @@ main(int argc, char **argv)
pubkeys = 1;
break;
#endif
+ case 'C':
+ add_changelog = 1;
+ break;
default:
usage(1);
}
@@ -165,7 +171,12 @@ main(int argc, char **argv)
if (!nopacks)
{
- if (repo_add_rpmdb_reffp(repo, reffp, REPO_USE_ROOTDIR | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE | (percent ? RPMDB_REPORT_PROGRESS : 0)))
+ int flags = REPO_USE_ROOTDIR | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE;
+ if (percent)
+ flags |= RPMDB_REPORT_PROGRESS;
+ if (add_changelog)
+ flags |= RPM_ADD_WITH_CHANGELOG;
+ if (repo_add_rpmdb_reffp(repo, reffp, flags))
{
fprintf(stderr, "rpmdb2solv: %s\n", pool_errstr(pool));
exit(1);