1 |
commit: bc2b43acff4bb72ccd97324496d7f8b05f209167 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 31 11:10:09 2022 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 31 11:10:09 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=bc2b43ac |
7 |
|
8 |
scripts/auto-bootstraps/dobootstrap: do some more guessing for Linux systems |
9 |
|
10 |
try to deal with missing lsb_release, add case for Gentoo systems not to |
11 |
include a "release" |
12 |
|
13 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
14 |
|
15 |
scripts/auto-bootstraps/dobootstrap | 12 ++++++++++++ |
16 |
1 file changed, 12 insertions(+) |
17 |
|
18 |
diff --git a/scripts/auto-bootstraps/dobootstrap b/scripts/auto-bootstraps/dobootstrap |
19 |
index fd9bd75dd0..b4042a66e0 100755 |
20 |
--- a/scripts/auto-bootstraps/dobootstrap |
21 |
+++ b/scripts/auto-bootstraps/dobootstrap |
22 |
@@ -140,6 +140,18 @@ do_prepare() { |
23 |
# UNIX vendors |
24 |
local dist=$(lsb_release -si) |
25 |
local rel=$(lsb_release -sr) |
26 |
+ if [[ -z ${dist} ]] || [[ -z ${rel} ]] ; then |
27 |
+ source /etc/os-release # this may fail if the file isn't there |
28 |
+ [[ -z ${dist} ]] && dist=${NAME} |
29 |
+ [[ -z ${dist} ]] && dist=${ID} |
30 |
+ [[ -z ${rel} ]] && rel=${VERSION_ID} |
31 |
+ |
32 |
+ # Gentoo's versioning isn't really relevant, since it is |
33 |
+ # a rolling distro |
34 |
+ [[ ${dist,,} == "gentoo" ]] && rel= |
35 |
+ fi |
36 |
+ [[ -z ${dist} ]] && dist=linux |
37 |
+ # leave rel unset/empty if we don't know about it |
38 |
while [[ ${rel} == *.*.* ]] ; do |
39 |
rel=${rel%.*} |
40 |
done |