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

distrobox-export --app misbehaves when distrobox name contains name of application #1106

Closed
yump opened this issue Dec 19, 2023 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@yump
Copy link
Contributor

yump commented Dec 19, 2023

If the name of the distrobox has the name of the application (example: "foo") as a substring, distrobox-export --app foo will create an extra .desktop file that attempts to re-enter the container from inside the container. Also, the intended export will have the wrong icon.

To Reproduce

Assemble from this ini:

[codium-test-fedora-39]
image=fedora:39
start_now=true
pre_init_hooks=dnf -y install dnf-plugins-core
pre_init_hooks=dnf config-manager --save --setopt=max_parallel_downloads=20
pre_init_hooks=rpmkeys --import https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg
pre_init_hooks=printf '[gitlab.com_paulcarroty_vscodium_repo]\nname=download.vscodium.com\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h\n' >/etc/yum.repos.d/vscodium.repo
additional_packages="codium"
exported_apps="codium"

Observe bogus .desktop launcher (the 2nd one):

> ls -1tr ~/.local/share/applications/*test-fedora-39*
/home/rhaley/.local/share/applications/codium-test-fedora-39.desktop
/home/rhaley/.local/share/applications/codium-test-fedora-39-codium-test-fedora-39.desktop
/home/rhaley/.local/share/applications/codium-test-fedora-39-codium-url-handler.desktop
/home/rhaley/.local/share/applications/codium-test-fedora-39-codium.desktop

The exec line is:

Exec=/usr/bin/distrobox-enter  -n codium-test-fedora-39 -- /bin/sh -l -c  /usr/bin/distrobox enter  codium-test-fedora-39

And the launcher for codium uses the icon for fedora:

> grep -i icon ~/.local/share/applications/codium-test-fedora-39-codium.desktop
Icon=/run/host/home/rhaley/.local/share/icons/fedora.png
Icon=/run/host/home/rhaley/.local/share/icons/fedora.png

Expected behavior

If distrobox is instead called cod1um-test-fedora-39, there are only 3 .desktop files, and codium has the correct icon:

> ls -1tr ~/.local/share/applications/*test-fedora-39*
/home/rhaley/.local/share/applications/cod1um-test-fedora-39.desktop
/home/rhaley/.local/share/applications/cod1um-test-fedora-39-codium-url-handler.desktop
/home/rhaley/.local/share/applications/cod1um-test-fedora-39-codium.desktop
> grep -i icon ~/.local/share/applications/cod1um-test-fedora-39-codium.desktop
Icon=vscodium
Icon=vscodium

Logs

I commented out the export from the .ini and manually ran distrobox-export --app --verbose, resulting in this export.log

Desktop (please complete the following information):

Host: Fedora 39
distrobox: 1.6.0.1 from dnf
podman: 4.8.1

Additional context

If I'm reading the code correctly, there's a filter that's supposed to prevent this, but it doesn't seem to be working.

@yump yump added the bug Something isn't working label Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant