openframeworks / openframeworks/openFrameworks

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

Open
#7,914 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read scripts/linux/ubuntu/install_dependencies.sh, focusing on where lsb_release is used to set RELEASE before the later code paths. Run the script in an Ubuntu-based container that lacks lsb_release; done means the dependency is available before those checks and RELEASE is no longer empty.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell, ubuntu
Domain
build-system, devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.