Giter VIP home page Giter VIP logo

Comments (10)

bska avatar bska commented on August 20, 2024

The issue is probably caused by commit b2520ab (Pull Request #147). I have no idea how to solve this issue in a portable manner, but clearly one cannot assume that /etc/lsb-release exists as a readable file. However, there may be another solution. Do you by any chance have a lsb_release(1) utility on your openSUSE system?

For instance, the following command produces reasonable output on both Ubuntu 10.04 LTS and CentOS 5.9

$ lsb_release -i -r -c

I don't know how portable lsb_release(1) is (or its options). It is definitely not specified by SUS meaning it is, at best, a Linux-specific solution. That may be sufficient, though.

from opm-core.

andlaus avatar andlaus commented on August 20, 2024

the lsb-release tool is available, but if I don't hand it any parameters it just returns n/a (probably because /etc/lsb-release does not exist):

lauser@aladdin:~ > lsb-release 
LSB Version:    n/a

however, with your options, it seems to produce usable information:

lauser@aladdin:~ > lsb_release -i -r -c
Distributor ID: SUSE LINUX
Release:        12.2
Codename:       Mantis

from opm-core.

andlaus avatar andlaus commented on August 20, 2024

I forgot to mention: newer distributions should also have the file /etc/os-release around:

lauser@aladdin:~ > cat /etc/os-release
NAME=openSUSE
VERSION="12.2 (Mantis)"
VERSION_ID="12.2"
PRETTY_NAME="openSUSE 12.2 (Mantis) (x86_64)"
ID=opensuse
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:opensuse:12.2"

from opm-core.

andlaus avatar andlaus commented on August 20, 2024

actually, systemd based distris have it. not sure about ubuntu: http://www.0pointer.de/blog/projects/os-release

from opm-core.

bska avatar bska commented on August 20, 2024

actually, systemd based distris have it. not sure about ubuntu

Ubuntu 12.04 LTS appears to have /etc/os-release. Anyway, here is an ugly hack to construct a human-readable representation of an OS identity

$ lsb_release -irc | awk '{s = s "-" $NF} END {print substr(s, 2)}'

On my Ubuntu 10.04 LTS system, this produces Ubuntu-10.04-lucid, while I get CentOS-5.9-Final on a CentOS 5.9 system. Maybe this is could be used as a basis for further development?

from opm-core.

andlaus avatar andlaus commented on August 20, 2024

possibly. But let's wait what @rolk has to say about it...

from opm-core.

bska avatar bska commented on August 20, 2024

let's wait what @rolk has to say about it...

Absolutely. There is also the option of using lsb_release -d, but this is the last plug I'll make for lsb_release(1).

from opm-core.

rolk avatar rolk commented on August 20, 2024

This bug has already been fixed as part of the commits in issue #145

from opm-core.

andlaus avatar andlaus commented on August 20, 2024

well, unfortunately that's not always the case: this morning it was still present in the release branch:

http://opm-project.org/CDash/viewConfigure.php?buildid=1444

from opm-core.

andlaus avatar andlaus commented on August 20, 2024

argh The fact that issue #145 is still unmerged slipped my attention! sorry...

from opm-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.