openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.94k stars 2.55k forks source link

scripts/linux/ubuntu/install_dependencies.sh: lsb_release might not be installed before it is used in the script #7914

Open shvaikop opened 6 months ago

shvaikop commented 6 months ago

Hi,

I had an issue with scripts/linux/ubuntu/install_dependencies.sh. The call to lsb_release in

if [ "$ID" = "elementary" ]; then
    # Gets ubuntu base version
    RELEASE=$(lsb_release -r -u)
elif [ "$ID" = "linuxmint" ]; then
    # Gets ubuntu base version
    RELEASE=$(cat /etc/upstream-release/lsb-release | grep DISTRIB_RELEASE | cut -d "=" -f2)
else
    RELEASE=$(lsb_release -r)
fi

returns error if it is not installed and RELEASE ends up being empty resulting in wrong code path later on.

It's not a big deal but I noticed it while trying to automate the build process inside a docker container.

I think it would be a nice idea to try to install the tool with apt-get update && apt-get install -y lsb-release before it is used. What do you think?

Thanks

dimitre commented 5 months ago

Sure thing! do you want to submit a PR to address this issue?