Skip to content

Commit 7251df8

Browse files
committed
fixup! bin/xbps-rindex: implement multi repo staging
1 parent 2a4a097 commit 7251df8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

bin/xbps-rindex/index-add.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ print_staged_packages(struct repo_state *states, unsigned nstates)
462462
const char *pkgver = NULL, *arch = NULL;
463463
xbps_dictionary_get_cstring_nocopy(pkg, "pkgver", &pkgver);
464464
xbps_dictionary_get_cstring_nocopy(pkg, "architecture", &arch);
465-
printf("stage: added `%s' (%s)\n", pkgver, arch);
465+
printf("%s: stage: added `%s' (%s)\n", state->repodir, pkgver, arch);
466466
}
467467

468468
xbps_object_iterator_release(iter);
@@ -491,7 +491,8 @@ unstage(struct repo_state *state)
491491
if (!xbps_dictionary_get_cstring_nocopy(pkg, "architecture", &arch))
492492
abort();
493493

494-
printf("index: added `%s' (%s).\n", pkgver, arch);
494+
printf("%s: index: added `%s' (%s).\n", state->repodir,
495+
pkgver, arch);
495496

496497
if (!xbps_dictionary_set(state->index, pkgname, pkg)) {
497498
xbps_object_iterator_release(iter);
@@ -560,8 +561,13 @@ commit(struct repo_state *states, unsigned nstates)
560561

561562
for (unsigned i = 0; i < nstates; i++) {
562563
struct repo_state *state = &states[i];
563-
// XXX: kinda useless to print for all repos, also print stage?.
564-
printf("index: %u packages registered.\n", xbps_dictionary_count(state->index));
564+
printf("%s: index: %u packages registered.\n",
565+
state->repodir, xbps_dictionary_count(state->index));
566+
if (xbps_dictionary_count(state->stage) != 0) {
567+
printf("%s: stage: %u packages registered.\n",
568+
state->repodir,
569+
xbps_dictionary_count(state->stage));
570+
}
565571
}
566572

567573
r = 0;

0 commit comments

Comments
 (0)