Skip to content

Conversation

Sylvain78
Copy link

Add missing references to Haiku package manager.

@@ -1261,6 +1272,7 @@ let update ?(env=OpamVariable.Map.empty) config =
if test.install then None else Some (`AsUser "false", [])
| Freebsd -> None
| Gentoo -> Some (`AsAdmin "emerge", ["--sync"])
| Haiku -> Some (`AsAdmin "pkgman", ["update"])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
| Haiku -> Some (`AsAdmin "pkgman", ["update"])
| Haiku -> Some (`AsUser "pkgman", ["full-sync"])

@@ -1026,6 +1035,7 @@ let package_manager_name_t ?(env=OpamVariable.Map.empty) config =
`AsUser "false"
| Freebsd -> `AsAdmin "pkg"
| Gentoo -> `AsAdmin "emerge"
| Haiku -> `AsAdmin "pkgman"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
| Haiku -> `AsAdmin "pkgman"
| Haiku -> `AsUser "pkgman"

Copy link
Member

Choose a reason for hiding this comment

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

Haiku doesn't seem to have sudo/doas or any sort of distinction between admin and users as far as the package manager is concerned. It has su though so maybe? Do you know where this is documented? I couldn't find if haiku has a notion of superuser/privileged user

Comment on lines +870 to +872
run_query_command "pkgman" ["search"; "%n\n%o"]
|> List.map OpamSysPkg.of_string
|> OpamSysPkg.Set.of_list
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't work at all. I've looked into it and the best we can do seems to be -a/--all but we need to extract a list from that (extract the second column after the ----- line). We could even extract the list of installed packages this way by looking at the first column (if it contains s, S, h or H then it is installed). Or we could wait for #6489 and split the two into pkgman search -a and pkgman search -i -a

Suggested change
run_query_command "pkgman" ["search"; "%n\n%o"]
|> List.map OpamSysPkg.of_string
|> OpamSysPkg.Set.of_list
run_query_command "pkgman" ["search"; "-a"]
|> some_post_processing

@kit-ty-kate kit-ty-kate marked this pull request as draft August 24, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants