Skip to content

Commit

Permalink
CHANGE: better information in system/build/os about build on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Feb 12, 2023
1 parent 1bc5cdb commit 0d5d91e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
7 changes: 4 additions & 3 deletions make/pre-make.r3
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ arch: any [
all [word? spec/target-arch spec/target-arch]
]
os: any [
select get-os-info 'ID
all [word? spec/os spec/os]
select #(
Macintosh: macos
Expand Down Expand Up @@ -182,9 +183,9 @@ abi: any [
reactos: pe
beos: pe
linux: elf
alpine: musl
) os
]
;alpine: musl
) spec/os
]

product: any [spec/product 'Core]
configs: unique any [spec/config copy []]
Expand Down
24 changes: 24 additions & 0 deletions make/tools/utils.reb
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,27 @@ get-libc-version: function[][
ver
]

get-os-info: function[
"Tries to collect information about hosting Linux operating system"
][
tmp: copy ""
out: copy #()
key: charset [#"A"-#"Z" #"_"]
enl: system/catalog/bitsets/crlf
whs: system/catalog/bitsets/whitespace
try [
call/output/shell/wait "cat /etc/*-release" :tmp
parse tmp [
any [
copy k: some key #"=" copy v: to enl some whs (
try [v: transcode/one v]
try [parse v ["http" to end (v: as url! v)]]
put out to word! k v
)
| thru enl
]
]
]
out
]

0 comments on commit 0d5d91e

Please sign in to comment.