Skip to content

Conversation

@Duncaen
Copy link
Member

@Duncaen Duncaen commented Dec 9, 2025

No description provided.

@Duncaen Duncaen changed the title ulti repo staging multi repo staging Dec 9, 2025
Copy link
Member

@classabbyamp classabbyamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall this looks sound, I think

xbps_object_iterator_t iter;
xbps_object_t keysym;

// XXX: should this really print all staged packages every time?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo no, it should only print the new ones (like index: added ... does)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current version prints everything since there is nothing really tracking what was added last, it just always adds to the stage then runs the staging check and unstages if possible. I could probably just add another xbps_array_t with all the newly added package versions and just print them as is.


for (unsigned i = 0; i < nstates; i++) {
struct repo_state *state = &states[i];
// XXX: kinda useless to print for all repos, also print stage?.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo it would be useful to print the stage count too. maybe this could be prefixed by the repo path?

/path/to/repo: index: %u packages registered.

Copy link
Member Author

@Duncaen Duncaen Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment about it being "useless" is that previously xbps-rindex could only add packages to one repo at a time and so printing the stats for just that repo that was being modified would've made sense. But theoretically with this change unless I'm missing something you could add all packages in different repositories with one xbps-rindex call.

So i guess it depends whether that is allowed or not.

Not sure if the distinction makes sense, since the xbps-rindex call that unstages the repo, unstages not just the repo we added to in that case printing stats for those repos too makes sense. Maybe its good to track and print stats only for modified repos.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing command [ xbps-rindex -v -R repo1 -R repo2 -a repo1/A-1.0_2.noarch.xbps ]
Fail: stdout not empty
--- /dev/null   2025-12-08 15:08:46.234592808 +0000
+++ /tmp/kyua.gj0Txk/2/work/check.l1bqlW/stdout 2025-12-09 20:17:43.372614626 +0000
@@ -0,0 +1,11 @@
+Inconsistent shlibs:
+  libruby.so.3.3 (provided by: ruby; used by: B)
+repo1: stage: added `A-1.0_2' (noarch)
+repo1: stage: added `flac-1.5.0_1' (noarch)
+repo1: stage: added `ruby-3.4.5_1' (noarch)
+repo2: stage: added `AA-1.0_2' (noarch)
+repo2: stage: added `BB-1.0_2' (noarch)
+repo1: index: 5 packages registered.
+repo1: stage: 3 packages registered.
+repo2: index: 3 packages registered.
+repo2: stage: 2 packages registered.

I think its a bit noisy if it always prints it for all registered repos.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be ok (and more ergonomic and expected by the user) to allow adding packages to multiple repos in one invocation, especially when the repo can be modified during staging checks anyways

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing command [ xbps-rindex -v -R repo1 -R repo2 -a repo1/A-1.0_2.noarch.xbps ]
Fail: stdout not empty
--- /dev/null   2025-12-08 15:08:46.234592808 +0000
+++ /tmp/kyua.XduQkk/2/work/check.fkj0Ml/stdout 2025-12-09 20:37:00.678680807 +0000
@@ -0,0 +1,5 @@
+Inconsistent shlibs:
+  libruby.so.3.3 (provided by: ruby; used by: B)
+repo1: stage: added `A-1.0_2' (noarch)
+repo1: index: 5 packages registered.
+repo1: stage: 3 packages registered.

with the latest fixup, it will only print the newly added package and only print stats for repos that have been modified.


// remove all shlibs that are still provided by a staged package
while ((keysym = xbps_object_iterator_next(iter))) {
// const char *pkgname = xbps_dictionary_keysym_cstring_nocopy(keysym);

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants