From: "Bird, Tim" <Tim.Bird@sony.com>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Linux Doc Mailing List <linux-doc@vger.kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Markus Heiser <markus.heiser@darmarit.de>
Subject: RE: [PATCH 1/6] scripts: sphinx-pre-install: improve distro detection check
Date: Wed, 8 Apr 2020 17:01:20 +0000 [thread overview]
Message-ID: <MWHPR13MB08950C5CC92A0C0FE0532AFAFDC00@MWHPR13MB0895.namprd13.prod.outlook.com> (raw)
In-Reply-To: <2f22c8a80a4740176fabdee0d0cd23dbe7395b03.1586361086.git.mchehab+huawei@kernel.org>
> -----Original Message-----
> From: Mauro Carvalho Chehab <mchehab@kernel.org> On Behalf Of Mauro Carvalho Chehab
>
> The Arch-linux detection is hit by catting /etc/issue, whose
> contents is (nowadays):
>
> Arch Linux \r (\l)
>
> It sounds a little ackward to print such string, so,
> instead, let's use the /etc/os-release file, with exists
> on lots of distributions and should provide a more reliable
> result.
>
> We'll keep the old tests before it, in order to avoid possible
> regressions with the other distros, although the new way should
> probably work on all the currently supported distributions.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
> scripts/sphinx-pre-install | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
> index fa3fb05cd54b..c2071a1c69ea 100755
> --- a/scripts/sphinx-pre-install
> +++ b/scripts/sphinx-pre-install
> @@ -780,6 +780,24 @@ $system_release = catcheck("/etc/system-release") if !$system_release;
> $system_release = catcheck("/etc/redhat-release") if !$system_release;
> $system_release = catcheck("/etc/lsb-release") if !$system_release;
> $system_release = catcheck("/etc/gentoo-release") if !$system_release;
> +
> +# This seems more common than LSB those days
should 'those' be 'these'?
> +if (!$system_release) {
> + my %os_var;
> + if (open IN, "cat /etc/os-release|") {
> + while (<IN>) {
> + if (m/^([\w\d\_]+)=\"?([^\"]*)\"?\n/) {
> + $os_var{$1}=$2;
> + }
> + }
> + $system_release = $os_var{"NAME"};
> + if (defined($os_var{"VERSION_ID"})) {
> + $system_release .= " " . $os_var{"VERSION_ID"} if (defined($os_var{"VERSION_ID"}));
> + } else {
> + $system_release .= " " . $os_var{"VERSION"};
> + }
> + }
> +}
> $system_release = catcheck("/etc/issue") if !$system_release;
> $system_release =~ s/\s+$//;
>
> --
> 2.25.2
next prev parent reply other threads:[~2020-04-08 17:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-08 15:55 [PATCH 0/6] sphinx-pre-install improvements for Kernel 5.8 Mauro Carvalho Chehab
2020-04-08 15:55 ` [PATCH 1/6] scripts: sphinx-pre-install: improve distro detection check Mauro Carvalho Chehab
2020-04-08 17:01 ` Bird, Tim [this message]
2020-04-08 15:55 ` [PATCH 2/6] scripts: sphinx-pre-install: improve openSuse Tumbleweed check Mauro Carvalho Chehab
2020-04-08 15:55 ` [PATCH 3/6] scripts: sphinx-pre-install: fix a dependency hint with Ubuntu 16.04 Mauro Carvalho Chehab
2020-04-08 15:55 ` [PATCH 4/6] scripts: sphinx-pre-install: address some issues with Gentoo Mauro Carvalho Chehab
2020-04-08 15:55 ` [PATCH 5/6] scripts: sphinx-pre-install: add support for OpenMandriva Mauro Carvalho Chehab
2020-04-08 15:55 ` [PATCH 6/6] scripts: sphinx-pre-install: add support for python -m venv Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MWHPR13MB08950C5CC92A0C0FE0532AFAFDC00@MWHPR13MB0895.namprd13.prod.outlook.com \
--to=tim.bird@sony.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=markus.heiser@darmarit.de \
--cc=mchehab+huawei@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).