summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/lsb.py
Commit message (Collapse)AuthorAgeFilesLines
* lib/oe/lsb: sanitise the distro identifierRoss Burton2016-04-131-0/+5
| | | | | | | | | | | | | | | | The distribution identifier is often used to create filenames, so it needs to be safe to use as a filename. Whilst most distributions have e.g. Fedora or Debian as their name, it is possible that the name contains special characters. To ensure this doesn't cause a problem strip out any non-alphanumerics from the distribution name before returning it. [ YOCTO #9443 ] (From OE-Core rev: 8a96a7207561e00eb92e4fb69e7340f20bfa2053) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/lsb.py: Prioritize parsing of /etc/os-releaseEd Bartosh2015-03-221-8/+9
| | | | | | | | | | | | | | | Moved parsing of /etc/os-release before parsing of /etc/SuSE-release as /etc/SuSE-release is deprecated in recent releases of OpenSuSE. Here is the quote from /etc/SuSE-release: /etc/SuSE-release is deprecated and will be removed in the future, use /etc/os-release instead (From OE-Core rev: b3852bebb850048389994993e3717e54020c662f) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/lsb.py: Fix up for dashSaul Wold2015-02-141-0/+1
| | | | | | | | | | Remove the leading -e when using dash which does not use -e with echo (From OE-Core rev: 105280d58f7be50e5aee6a33ef1aa89dd6485cbf) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/lsb.py: fall back to /etc/os-release for host distro IDPaul Eggleton2013-07-021-2/+14
| | | | | | | | | | | | | | | | | | | | The new standard for host distribution identification [1] is /etc/os-release, and a number of newer distributions provide this file, so add support for this in order to pick up more distributions. Additionally, handle "rolling release" style distributions that don't report a version number, e.g. Arch Linux. With this change we can identify the most common distributions, so this should satisfy [YOCTO #4271]. Note that this doesn't imply support for these distros as build hosts, just that we can identify them. [1] http://www.freedesktop.org/software/systemd/man/os-release.html (From OE-Core rev: bff50b747cde04007ead65dde4207b16a8e1bf08) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib/oe/lsb.py: extract only the needed info from lsb-releaseCristian Iorga2013-03-301-2/+2
| | | | | | | | | | | | | | Instead of running lsb_release -a, a lsb_release -ir will be run. This will prevent issue with distros that don't have all the needed info in /etc/lsb-release file, in which case lsb_release won't generate an error code. Partial fix for [YOCTO #4071] (From OE-Core rev: 79a2252545ab50c79e00e02c328191c1163f917d) Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib/oe/lsb.py: fix data extraction from /etc/lsb-releaseCristian Iorga2013-03-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | In some cases, /etc/lsb-release file is used to extract info about poky build host machine. But the strings are not stripped of end of line special characters. As such, when this info is concatenated and used as a directory entry in sstate_cache, this is an issue. Usually, this issue is masked by the fact that distro related info is extracted from the output of lsb_release command. In case of Yocto Linux, running "lsb_release -a" will give an error code because CODENAME info is not present. As such, bitbake will extract the info from /etc/lsb-release, running into the above issue. Consequence is that building under BA will crash. Partial fix for [YOCTO #4071] (From OE-Core rev: 5d0839bef631dceb4395fcf204779a76966a1061) Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/lsb: enable getting distro ID when lsb_release is not installedPaul Eggleton2013-03-141-2/+37
| | | | | | | | | | | | | | If lsb_release is not installed (as it may not be on headless/minimal installations on distros whose LSB package has a long list of dependencies) we need to gather the information directly from files in /etc. Fixes [YOCTO #4012]. (From OE-Core rev: 106a7bcdb5ad9956f1d78f508408bfbcf7ff5120) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* distro_identifier: replace slash with hyphenMihai Lindner2012-10-271-1/+1
| | | | | | | | | | | | Use "-" instead of "/" in "n/a" strings ("Distributor ID" and/or "Release"), provided by `lsb_release`. This leads to directories and subdirectories created in ./sstate-cache/ e.g. Distro-n/a/ where "Distro-n" is dir and "a" is subdir. (From OE-Core rev: c2a9f0c330f0da82792f87e3860b06c25b986983) Signed-off-by: Mihai Lindner <mihaix.lindner@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/lsb.py: Map unknown distributions to 'Unknown'Richard Purdie2012-07-311-2/+8
| | | | | | (From OE-Core rev: e12df2ca5c71ad672ebbfefbc47cabbac3333d61) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/lsb: Add basic LSB functionsRichard Purdie2012-07-281-0/+28
This code was written by Christopher Larson <chris_larson@mentor.com> and allows generation of the LSB release data based upon the lsb_release command. It also includes a helper function to generate a string representing a given distribution. (From OE-Core rev: 458bdfe1cc4872e901ea3c38f497bfea6cf4c8cb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>