Skip to content

Commit

Permalink
CHANGE: modified version info
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Feb 10, 2023
1 parent 937c972 commit 759609a
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 9 deletions.
9 changes: 8 additions & 1 deletion make/pre-make.r3
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ try/except [
][ git-commit: none]

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


short-str-version: next ajoin [{
Rebol/} product SP version SP format-date-time now/utc "(yyyy-MM-dd hh:mm:ss UTC)" {
Copyright (c) 2012 REBOL Technologies
Copyright (c) 2012-} now/year { Rebol Open Source Contributors
Source: https://github.com/Oldes/Rebol3}]

ver3: version ver3/4: none ; trimmed version to just 3 parts
lib-version: version/1

Expand Down
6 changes: 4 additions & 2 deletions make/tools/make-boot.reb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ REBOL [
Title: "Make primary boot files"
Rights: {
Copyright 2012 REBOL Technologies
Copyright 2012-2023 Rebol Open Source Contributors
REBOL is a trademark of REBOL Technologies
}
License: {
Expand Down Expand Up @@ -548,8 +549,9 @@ emit [{
#define REBOL_UPD } any [version/3 0] {
#define REBOL_SYS } any [version/4 0] {
#define REBOL_VAR } any [version/5 0] {
#define REBOL_VERSION "} str-version {"
}]
// Version visible when used -v argument on start-up (before initialization)
#define REBOL_VERSION \} string-to-c short-str-version
]

;-- Generate Lower-Level String Table ----------------------------------------

Expand Down
10 changes: 10 additions & 0 deletions make/tools/utils.reb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ binary-to-c: func [comp-data /local out data] [
head out
]

string-to-c: func[str /local out][
out: copy ""
foreach line split str lf [
replace/all line #"^"" {\"}
append out ajoin [{^/^-"} line {\n"\}]
]
take/last out ;; removes the last slash
out
]

get-libc-version: function[][
tmp: copy ""
num: system/catalog/bitsets/numeric
Expand Down
9 changes: 8 additions & 1 deletion src/core/b-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ extern const REBYTE Str_Banner[];
{
if (rargs->options & RO_VERS) {
Out_Str(cb_cast(REBOL_VERSION), 0, FALSE);
Out_Str(cb_cast("\n"), 0, FALSE);
OS_EXIT(0);
}
}
Expand Down Expand Up @@ -366,10 +367,16 @@ extern const REBYTE Str_Banner[];
/*
// version: native [
// "Return Rebol version string"
// /data "loadable version"
// ]
***********************************************************************/
{
const REBYTE*version = BOOT_STR(RS_VERSION, 0);
const REBYTE*version;
if (D_REF(1)) {
version = BOOT_STR(RS_VERSION, 0);
} else {
version = cb_cast(REBOL_VERSION);
}
Set_String(ds, Copy_Bytes(version, LEN_BYTES(version)));
return R_RET;
}
Expand Down
4 changes: 2 additions & 2 deletions src/mezz/mezz-banner.reb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ REBOL [
Title: "REBOL 3 Mezzanine: Startup Banner"
Rights: {
Copyright 2012 REBOL Technologies
Copyright 2012-2022 Rebol Open Source Developers
Copyright 2012-2023 Rebol Open Source Developers
REBOL is a trademark of REBOL Technologies
}
License: {
Expand Down Expand Up @@ -55,7 +55,7 @@ sys/boot-banner: make-banner [
["REBOL/" system/product #" " system/version " (Oldes branch)"]
-
= Copyright: "2012 REBOL Technologies"
= "" "2012-2022 Rebol Open Source Contributors"
= "" "2012-2023 Rebol Open Source Contributors"
= "" "Apache 2.0 License, see LICENSE."
= Website: "https://github.com/Oldes/Rebol3"
-
Expand Down
7 changes: 4 additions & 3 deletions src/mezz/sys-start.reb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ REBOL [
Title: "REBOL 3 Boot Sys: Startup"
Rights: {
Copyright 2012 REBOL Technologies
Copyright 2012-2023 Rebol Open Source Contributors
REBOL is a trademark of REBOL Technologies
}
License: {
Expand Down Expand Up @@ -33,7 +34,7 @@ start: func [
start: 'done ; only once
init-schemes ; only once

ver: load/as lib/version 'unbound
ver: load/as lib/version/data 'unbound
system/product: ver/2
system/version: ver/3
system/platform: ver/4
Expand All @@ -46,6 +47,7 @@ start: func [
system/build/target: ver/11
system/build/date: ver/12
system/build/git: ver/13
system/build/libc: ver/14

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

Expand All @@ -55,8 +57,7 @@ start: func [
any [flags/verbose flags/usage flags/help]
][
; basic boot banner only
prin "^/ "
print boot-banner: form ver
print boot-banner: lib/version
]
if any [do-arg script] [quiet: true]

Expand Down

0 comments on commit 759609a

Please sign in to comment.