diff -r 5b0601d184ed -r 4b0a1201342a src/import-yum.c --- a/src/import-yum.c Mon Jun 23 09:59:08 2008 -0400 +++ b/src/import-yum.c Mon Jun 23 20:20:08 2008 -0400 @@ -62,6 +62,8 @@ char pkgid[128]; uint32_t property_type; int state; + + int total, current; }; static uint32_t @@ -90,7 +92,12 @@ uint32_t pre, relation, flags; int i; - if (strcmp(name, "name") == 0) { + if (strcmp(name, "metadata") == 0) { + for (i = 0; atts[i]; i += 2) { + if (strcmp(atts[i], "packages") == 0) + ctx->total = atoi(atts[i + 1]); + } + } else if (strcmp(name, "name") == 0) { ctx->state = YUM_STATE_PACKAGE_NAME; ctx->p = ctx->name; } else if (strcmp(name, "arch") == 0) { @@ -208,6 +215,9 @@ XML_StopParser(ctx->current_parser, XML_TRUE); ctx->current_parser = ctx->filelists_parser; + + printf("\rimporting %d/%d", ++ctx->current, ctx->total); + fflush(stdout); } } @@ -313,6 +323,8 @@ ctx.current_parser = ctx.primary_parser; + ctx.current = 0; + do { XML_GetParsingStatus(ctx.current_parser, &status); switch (status.parsing) { @@ -348,5 +360,6 @@ gzclose(primary); gzclose(filelists); + printf ("\nsaving\n"); return razor_importer_finish(ctx.importer); }