OMPython
OMPython copied to clipboard
Linux download instructions breaks for Docker slim-jessie debian distribution
Within the instructions for downloading OpenModelica for Linux there is the command:
for deb in deb deb-src; do echo "$deb http://build.openmodelica.org/apt `lsb_release -cs` nightly"; done | sudo tee /etc/apt/sources.list.d/openmodelica.list
However within the Docker image for python:3.5.5-slim-jessie there is no lsb_release command in order to save space, so this command fails. There is an alternative command that can be used to achieve the same goal but works on all Linux versions, even very slim ones, I just added extra conversions to make sure only the first word of the name is retrieved and that it is converted to lowercase to match the way your file system stores it:
awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release | awk '{print $1}' | awk '{ print tolower($0) }'