Skip to content
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

Add additional check for differently named Fedora-based distros #780

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

termdisc
Copy link
Contributor

@termdisc termdisc commented Dec 2, 2024

Bazzite is Fedora-based but fails the distro.id() == 'fedora' check because distro.id() resolves to "bazzite." I added an additional check to include distro.like() == 'fedora' for situations like this.

This needs to be formatted as an or statement because plain Fedora resolves distro.like() as a null string.

Bazzite is Fedora-based but fails the `distro.id() == 'fedora'` check because `distro.id()` resolves to "bazzite." I added an additional check to include `distro.like() == 'fedora'` for situations like this.

This needs to be formatted as an or statement because plain Fedora resolves `distro.like()` as a null string.
@axu2 axu2 merged commit ae475e7 into ciromattia:master Dec 13, 2024
@axu2
Copy link
Collaborator

axu2 commented Dec 14, 2024

Appreciated, is this related to Steam Deck or SteamOS? @termdisc

@termdisc
Copy link
Contributor Author

This is related to Bazzite, which does have a Deck-focused image, but I wasn’t using KCC on the Deck.

SteamOS would be Arch-based, so it shouldn’t be affected by this change.

@axu2
Copy link
Collaborator

axu2 commented Dec 19, 2024

@termdisc I saw your readme update. Do you think updating where KCC searches for kindlegen would be easier than user modifying path?

kcc/kcc.py

Lines 35 to 40 in 434fe90

if getattr(sys, 'frozen', False):
os.environ['PATH'] += os.pathsep + os.pathsep.join(mac_paths +
[
'/opt/homebrew/bin',
'/usr/local/bin',
'/usr/bin',

Looks like we only add windows/mac paths

@termdisc
Copy link
Contributor Author

@axu2 Adding ~/.local/bin/ would be a fair addition because that's a common place where one would put userspace binaries. It wouldn't strictly need to be added to PATH if you add manual searching there.

I'm not well-versed in Python, but it looks like pathlib.Path.home can help resolve this with Path.home() / ".local" / "bin" so that we ensure that we capture the user name as part of the folder path.

@axu2
Copy link
Collaborator

axu2 commented Dec 21, 2024

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