Skip to content

Commit 759609a

Browse files
committed
CHANGE: modified version info
1 parent 937c972 commit 759609a

File tree

6 files changed

+36
-9
lines changed

6 files changed

+36
-9
lines changed

make/pre-make.r3

+8-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ try/except [
220220
][ git-commit: none]
221221

222222
str-version: reform [
223-
"Rebol" ; probably always same
223+
"Rebol" ; probably always same
224224
product ; like Core, View, etc...
225225
version ; triple value product version
226226
platform ; Linux, Windows, macOS, Android...
@@ -236,6 +236,13 @@ str-version: reform [
236236
get-libc-version ;; musl, glibc_2.28,... or just none
237237
]
238238

239+
240+
short-str-version: next ajoin [{
241+
Rebol/} product SP version SP format-date-time now/utc "(yyyy-MM-dd hh:mm:ss UTC)" {
242+
Copyright (c) 2012 REBOL Technologies
243+
Copyright (c) 2012-} now/year { Rebol Open Source Contributors
244+
Source: https://github.com/Oldes/Rebol3}]
245+
239246
ver3: version ver3/4: none ; trimmed version to just 3 parts
240247
lib-version: version/1
241248

make/tools/make-boot.reb

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ REBOL [
33
Title: "Make primary boot files"
44
Rights: {
55
Copyright 2012 REBOL Technologies
6+
Copyright 2012-2023 Rebol Open Source Contributors
67
REBOL is a trademark of REBOL Technologies
78
}
89
License: {
@@ -548,8 +549,9 @@ emit [{
548549
#define REBOL_UPD } any [version/3 0] {
549550
#define REBOL_SYS } any [version/4 0] {
550551
#define REBOL_VAR } any [version/5 0] {
551-
#define REBOL_VERSION "} str-version {"
552-
}]
552+
// Version visible when used -v argument on start-up (before initialization)
553+
#define REBOL_VERSION \} string-to-c short-str-version
554+
]
553555

554556
;-- Generate Lower-Level String Table ----------------------------------------
555557

make/tools/utils.reb

+10
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@ binary-to-c: func [comp-data /local out data] [
113113
head out
114114
]
115115

116+
string-to-c: func[str /local out][
117+
out: copy ""
118+
foreach line split str lf [
119+
replace/all line #"^"" {\"}
120+
append out ajoin [{^/^-"} line {\n"\}]
121+
]
122+
take/last out ;; removes the last slash
123+
out
124+
]
125+
116126
get-libc-version: function[][
117127
tmp: copy ""
118128
num: system/catalog/bitsets/numeric

src/core/b-init.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ extern const REBYTE Str_Banner[];
122122
{
123123
if (rargs->options & RO_VERS) {
124124
Out_Str(cb_cast(REBOL_VERSION), 0, FALSE);
125+
Out_Str(cb_cast("\n"), 0, FALSE);
125126
OS_EXIT(0);
126127
}
127128
}
@@ -366,10 +367,16 @@ extern const REBYTE Str_Banner[];
366367
/*
367368
// version: native [
368369
// "Return Rebol version string"
370+
// /data "loadable version"
369371
// ]
370372
***********************************************************************/
371373
{
372-
const REBYTE*version = BOOT_STR(RS_VERSION, 0);
374+
const REBYTE*version;
375+
if (D_REF(1)) {
376+
version = BOOT_STR(RS_VERSION, 0);
377+
} else {
378+
version = cb_cast(REBOL_VERSION);
379+
}
373380
Set_String(ds, Copy_Bytes(version, LEN_BYTES(version)));
374381
return R_RET;
375382
}

src/mezz/mezz-banner.reb

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ REBOL [
33
Title: "REBOL 3 Mezzanine: Startup Banner"
44
Rights: {
55
Copyright 2012 REBOL Technologies
6-
Copyright 2012-2022 Rebol Open Source Developers
6+
Copyright 2012-2023 Rebol Open Source Developers
77
REBOL is a trademark of REBOL Technologies
88
}
99
License: {
@@ -55,7 +55,7 @@ sys/boot-banner: make-banner [
5555
["REBOL/" system/product #" " system/version " (Oldes branch)"]
5656
-
5757
= Copyright: "2012 REBOL Technologies"
58-
= "" "2012-2022 Rebol Open Source Contributors"
58+
= "" "2012-2023 Rebol Open Source Contributors"
5959
= "" "Apache 2.0 License, see LICENSE."
6060
= Website: "https://github.com/Oldes/Rebol3"
6161
-

src/mezz/sys-start.reb

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ REBOL [
33
Title: "REBOL 3 Boot Sys: Startup"
44
Rights: {
55
Copyright 2012 REBOL Technologies
6+
Copyright 2012-2023 Rebol Open Source Contributors
67
REBOL is a trademark of REBOL Technologies
78
}
89
License: {
@@ -33,7 +34,7 @@ start: func [
3334
start: 'done ; only once
3435
init-schemes ; only once
3536

36-
ver: load/as lib/version 'unbound
37+
ver: load/as lib/version/data 'unbound
3738
system/product: ver/2
3839
system/version: ver/3
3940
system/platform: ver/4
@@ -46,6 +47,7 @@ start: func [
4647
system/build/target: ver/11
4748
system/build/date: ver/12
4849
system/build/git: ver/13
50+
system/build/libc: ver/14
4951

5052
if flags/verbose [system/options/log/rebol: 3] ;maximum log output for system messages
5153

@@ -55,8 +57,7 @@ start: func [
5557
any [flags/verbose flags/usage flags/help]
5658
][
5759
; basic boot banner only
58-
prin "^/ "
59-
print boot-banner: form ver
60+
print boot-banner: lib/version
6061
]
6162
if any [do-arg script] [quiet: true]
6263

0 commit comments

Comments
 (0)