Skip to content

[Error] Symlinks in ~/.local/share/applications/ cause error when running grep #1742

Open
@TheBicPen

Description

@TheBicPen

Describe the bug
When running various distrobox commands like distrobox-export --verbose --list-apps, grep prints an error when the host has a symlink in ~/.local/share/applications/

To Reproduce
Distrobox.ini content:

[libjxl]

image="ubuntu:25.04"
nvidia=true
unshare_all=true
start_now=true

additional_packages="libjxl-tools"

Commands:

> ls -l ~/.local/share/applications/
lrwxrwxrwx    - alex 2023-07-02  com.valvesoftware.Steam.desktop -> /var/lib/flatpak/app/com.valvesoftware.Steam/current/active/export/share/applications/com.valvesoftware.Steam.desktop
...

> distrobox-assemble create --replace --file "distrobox.ini"
> distrobox enter libjxl -- bash --norc
bash-5.2$ distrobox-export --verbose --list-apps
+ [ ! -e /home/alex/.local/bin ]
+ [ ! -f /run/.containerenv ]
+ grep -q rootless=0 /run/.containerenv
+ id -u
+ [ 1000 -eq 0 ]
+ [ -n  ]
+ [ -n  ]
+ container_command_suffix='null'  "$@"
+ [ 0 -ne 0 ]
+ container_command_prefix=/usr/bin/distrobox-enter  -n libjxl  --  
+ [ -n  ]
+ [ -z  ]
+ exported_app_label= (on libjxl)
+ list_exported_applications
+ find /run/host/home/alex/.local/share/applications -type f -print -o -type l -print
+ sed s/./\\&/g
+ xargs -I{} grep -l -e Exec=.*/usr/bin/distrobox-enter.* {}
+ sed s/./\\&/g
+ xargs -I{} printf %s¤ {}
grep: /run/host/home/alex/.local/share/applications/com.valvesoftware.Steam.desktop: No such file or directory
+ desktop_files=
+ IFS=¤
+ unset IFS

Expected behavior
I don't expect the error to be printed. Maybe it causes errors elsewhere?

Logs
See above

Desktop (please complete the following information):

  • Are you using podman, docker or lilipod? podman
  • Which version or podman, docker or lilipod? podman version 4.9.3
  • Which version of distrobox? distrobox: 1.8.1.2
  • Which host distribution? KDE neon
  • How did you install distrobox? apt

Additional context
.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions