Skip to content

Read all store paths from profile item #1417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 29, 2023
Merged

Read all store paths from profile item #1417

merged 9 commits into from
Aug 29, 2023

Conversation

ipince
Copy link
Contributor

@ipince ipince commented Aug 23, 2023

instead of arbitrarily picking the first one

How was it tested?

CI tests

@ipince ipince requested a review from savil August 23, 2023 18:01
@ipince ipince force-pushed the rodrigo/store-paths branch from 723389d to 6e40636 Compare August 23, 2023 18:06
Copy link
Collaborator

@savil savil left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -133,7 +133,8 @@ func ProfileListIndex(args *ProfileListIndexArgs) (int, error) {
return -1, errors.Wrapf(err, "failed to get installable for %s", args.DevPkg.String())
}
for _, item := range items {
if pathInStore == item.nixStorePath {
if len(item.nixStorePaths) == 1 && // this should always be true
pathInStore == item.nixStorePaths[0] {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thisshould be true, yes.

Should we assert that by erroring if len of item.nixStorePaths > 1
OR just iterate over the item.nixStorePaths so we don't mind if the assumption is violated and things keep working...

}
nixStorePath := scanner.Text()
nixStorePaths := strings.Fields(scanner.Text())
Copy link
Collaborator

Choose a reason for hiding this comment

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

ooh TIL about strings.Fields

@ipince ipince force-pushed the rodrigo/store-paths branch from 2f9c980 to 33692fa Compare August 28, 2023 19:48
@ipince ipince force-pushed the rodrigo/rm-nixpkgs-profile-bug branch from 3b27d43 to 2ca4543 Compare August 28, 2023 21:18
@ipince ipince force-pushed the rodrigo/store-paths branch from 33692fa to 478b1ab Compare August 28, 2023 21:19
@ipince ipince force-pushed the rodrigo/rm-nixpkgs-profile-bug branch from 2ca4543 to 2166973 Compare August 29, 2023 02:57
@ipince ipince force-pushed the rodrigo/store-paths branch from 478b1ab to e53d6e1 Compare August 29, 2023 02:58
Base automatically changed from rodrigo/rm-nixpkgs-profile-bug to main August 29, 2023 04:18
@ipince ipince merged commit 945f5d8 into main Aug 29, 2023
@ipince ipince deleted the rodrigo/store-paths branch August 29, 2023 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants