Skip to content

Commit 0d5d91e

Browse files
committed
CHANGE: better information in system/build/os about build on Linux
1 parent 1bc5cdb commit 0d5d91e

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

make/pre-make.r3

+4-3
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ arch: any [
151151
all [word? spec/target-arch spec/target-arch]
152152
]
153153
os: any [
154+
select get-os-info 'ID
154155
all [word? spec/os spec/os]
155156
select #(
156157
Macintosh: macos
@@ -182,9 +183,9 @@ abi: any [
182183
reactos: pe
183184
beos: pe
184185
linux: elf
185-
alpine: musl
186-
) os
187-
]
186+
;alpine: musl
187+
) spec/os
188+
]
188189

189190
product: any [spec/product 'Core]
190191
configs: unique any [spec/config copy []]

make/tools/utils.reb

+24
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,27 @@ get-libc-version: function[][
140140
ver
141141
]
142142

143+
get-os-info: function[
144+
"Tries to collect information about hosting Linux operating system"
145+
][
146+
tmp: copy ""
147+
out: copy #()
148+
key: charset [#"A"-#"Z" #"_"]
149+
enl: system/catalog/bitsets/crlf
150+
whs: system/catalog/bitsets/whitespace
151+
try [
152+
call/output/shell/wait "cat /etc/*-release" :tmp
153+
parse tmp [
154+
any [
155+
copy k: some key #"=" copy v: to enl some whs (
156+
try [v: transcode/one v]
157+
try [parse v ["http" to end (v: as url! v)]]
158+
put out to word! k v
159+
)
160+
| thru enl
161+
]
162+
]
163+
]
164+
out
165+
]
166+

0 commit comments

Comments
 (0)