DavidoTek / ProtonUp-Qt

Install and manage GE-Proton, Luxtorpeda & more for Steam and Wine-GE & more for Lutris with this graphical user interface.
https://davidotek.github.io/protonup-qt
GNU General Public License v3.0
1.24k stars 40 forks source link

/etc/lsb-release error in terminal output #148

Closed RaduAvramescu closed 1 year ago

RaduAvramescu commented 1 year ago

Describe the bug
When opening ProtonUp-Qt from the terminal, the following error can be observed: cat: /etc/lsb-release: No such file or directory

To Reproduce Steps to reproduce the behavior:

  1. Open a terminal
  2. Run flatpak run net.davidotek.pupgui2
  3. Observe the error in the terminal output

Expected behavior
The error does not appear in the terminal output

Desktop (please complete the following information):

Additional context
Of note is that the error appears twice, once before Loaded ctmod SteamTinkerLaunch and another time after. I assume /etc/lsb-release is distro specific as it does not exist on my Fedora system. However, /etc/os-release does exist and provides the following output, if it's helpful:

NAME="Fedora Linux"
VERSION="37 (Workstation Edition)"
ID=fedora
VERSION_ID=37
VERSION_CODENAME=""
PLATFORM_ID="platform:f37"
PRETTY_NAME="Fedora Linux 37 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:37"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f37/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=37
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=37
VARIANT="Workstation Edition"
VARIANT_ID=workstation

Terminal output

ProtonUp-Qt 2.7.6 by DavidoTek. Build Info: DavidoTek Flathub build.
Python 3.10.6 (main, Nov 10 2011, 15:00:00) [GCC 12.1.0], PySide 6.4.0.1
Platform: Linux-6.0.9-300.fc37.x86_64-x86_64-with-glibc2.35
Loading locale en / en_US
Loaded ctmod GE-Proton
Loaded ctmod Wine-GE
Loaded ctmod Boxtron
Loaded ctmod Kron4ek Wine-Builds Vanilla
Loaded ctmod Lutris-Wine
Loaded ctmod Luxtorpeda
Loaded ctmod Proton Tkg
Loaded ctmod Roberta
cat: /etc/lsb-release: No such file or directory
Loaded ctmod SteamTinkerLaunch
cat: /etc/lsb-release: No such file or directory
Loaded ctmod SteamTinkerLaunch-git
Loaded ctmod DXVK
Loaded ctmod DXVK Async
Loaded ctmod DXVK (nightly)
qt.pysideplugin: Environment variable PYSIDE_DESIGNER_PLUGINS is not set, bailing out.
qt.pysideplugin: No instance of QPyDesignerCustomWidgetCollection was found.
Gamepad error: No gamepad found.
RaduAvramescu commented 1 year ago

Related: https://github.com/DavidoTek/ProtonUp-Qt/issues/130#issuecomment-1281344440

DavidoTek commented 1 year ago

Thanks.

I'm wondering, does it cause any problems or is it just a message being displayed?

Nevertheless, I should change the code to use /etc/os-release I assume that the file exists on SteamOS as well. I will check that as it is the main purpose to detect if ProtonUp-Qt is running on the Steam Deck.

RaduAvramescu commented 1 year ago

Thanks.

I'm wondering, does it cause any problems or is it just a message being displayed?

Nevertheless, I should change the code to use /etc/os-release I assume that the file exists on SteamOS as well. I will check that as it is the main purpose to detect if ProtonUp-Qt is running on the Steam Deck.

Thanks as well!

No, I haven't encountered any issues other than https://github.com/DavidoTek/ProtonUp-Qt/issues/147 but it looks like that has already been fixed and it's unrelated.

Anyway, I'm not really sure if /etc/os-release is really "better" than /etc/lsb-release. The one that has the widest support (and still supports the Steam Deck) should be used by default, I suppose.

It would probably be a better idea to check if the former/latter exists on the system, and if it does, use that. If it doesn't exist, look for the other file. But I don't know anything about Python so I don't know how easy it is to do, and of course it's up to you to decide what is the best solution to go for.

sonic2kk commented 1 year ago

I know this is closed but just wanted to throw it out there: The check here is for Steam Deck / SteamOS in SteamTinkerLaunch. It's also the same check pretty much that SteamTinkerLaunch does itself to tell if it's on SteamOS. So the check in PUPQT would work on Steam Deck, but would show the error on distros that didn't have this file.

I have only tested ProtonUp-Qt on Arch and SteamOS 3, so I never caught this in testing :-) Good find!

DavidoTek commented 1 year ago

Yeah, I think this issue wasn't too big of a deal as of now as it either detects SteamOS or not (not here means not steamos or no file).

Could be useful in the future though if we need to, for some reason, detect other OSes.