-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix: make distrobox automatically disable, fix versioning #45
Conversation
return up, err | ||
} | ||
// check if file is executable using bitmask | ||
up.Config.Enabled = inf.Mode()&0111 != 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to check if the other ones exit when they get executed. Like, on that BootcCompatible
function and stuff. I'd also remove RunLog
from those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the bootc compat already checks if it exits. IMO we don't need these checks for flatpak or the system because they're expected to be there, and if they aren't there, the program should throw an unexpected error
We also don't use RunLog here, just a CombinedOutput:
func BootcCompatible(binaryPath string) (bool, error) {
cmd := exec.Command(binaryPath, "status", "--format=json")
out, err := cmd.CombinedOutput()
if err != nil {
return false, nil
}
var status bootcStatus
err = json.Unmarshal(out, &status)
if err != nil {
return false, nil
}
return !(status.Status.Booted.Incompatible || status.Status.Staged.Incompatible), nil
}
Whenever you feel this PR is done, please ping me! I'd like to test out those changes |
Check out the patch I sent you on discord, that should be the literal last thing to get this done. |
This PR makes the distrobox module disabled when the bin path isn't executable. I didn't make the changes to the other drivers because that would kinda be like "silently failing." If flatpak or bootc fail to update the user should probably know and the program should send an error.
This also makes it so there's proper versioning within the SPEC so it doesn't get built as "version 1.0" constantly