summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2022-05-31 13:10:09 +0200
committerFabian Groffen <grobian@gentoo.org>2022-05-31 13:10:09 +0200
commitbc2b43acff4bb72ccd97324496d7f8b05f209167 (patch)
tree0fcf9e93291ab39ca744c49a3549b039e19e9183
parentscripts/bootstrap-prefix: get a working bootstrapped bash on musl systems (diff)
downloadprefix-bc2b43ac.tar.gz
prefix-bc2b43ac.tar.bz2
prefix-bc2b43ac.zip
scripts/auto-bootstraps/dobootstrap: do some more guessing for Linux systems
try to deal with missing lsb_release, add case for Gentoo systems not to include a "release" Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rwxr-xr-xscripts/auto-bootstraps/dobootstrap12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/auto-bootstraps/dobootstrap b/scripts/auto-bootstraps/dobootstrap
index fd9bd75dd0..b4042a66e0 100755
--- a/scripts/auto-bootstraps/dobootstrap
+++ b/scripts/auto-bootstraps/dobootstrap
@@ -140,6 +140,18 @@ do_prepare() {
# UNIX vendors
local dist=$(lsb_release -si)
local rel=$(lsb_release -sr)
+ if [[ -z ${dist} ]] || [[ -z ${rel} ]] ; then
+ source /etc/os-release # this may fail if the file isn't there
+ [[ -z ${dist} ]] && dist=${NAME}
+ [[ -z ${dist} ]] && dist=${ID}
+ [[ -z ${rel} ]] && rel=${VERSION_ID}
+
+ # Gentoo's versioning isn't really relevant, since it is
+ # a rolling distro
+ [[ ${dist,,} == "gentoo" ]] && rel=
+ fi
+ [[ -z ${dist} ]] && dist=linux
+ # leave rel unset/empty if we don't know about it
while [[ ${rel} == *.*.* ]] ; do
rel=${rel%.*}
done