mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-18 02:19:39 +00:00
loader: Change version calculation to be more consistent.
Use 1000 * major + minor when calculating the version number that
gets set in the Ficl environment or lua loader property. This allows
for more room if the minor number needs to go above 9.
Add loader.version property to lua loader.
PR: 282001
Reviewed by: imp
Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D39631
(cherry picked from commit a50d73d578
)
This commit is contained in:
parent
c4ec2918f2
commit
dac5a2024b
@ -180,6 +180,7 @@ extern int isapnp_readport;
|
||||
* Version information
|
||||
*/
|
||||
extern char bootprog_info[];
|
||||
extern unsigned bootprog_rev;
|
||||
|
||||
/*
|
||||
* Interpreter information
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "bootstrap.h"
|
||||
#include "ficl.h"
|
||||
|
||||
extern unsigned bootprog_rev;
|
||||
INTERP_DEFINE("4th");
|
||||
|
||||
/* #define BFORTH_DEBUG */
|
||||
|
@ -55,6 +55,6 @@ fi
|
||||
|
||||
cat > $tempfile <<EOF
|
||||
char bootprog_info[] = "$bootprog_info";
|
||||
unsigned bootprog_rev = ${r%%.*}${r##*.};
|
||||
unsigned bootprog_rev = ${r%%.*} * 1000 + ${r##*.};
|
||||
EOF
|
||||
mv $tempfile vers.c
|
||||
|
@ -639,6 +639,8 @@ luaopen_loader(lua_State *L)
|
||||
lua_pushstring(L, LUA_PATH);
|
||||
lua_setfield(L, -2, "lua_path");
|
||||
lua_add_features(L);
|
||||
lua_pushinteger(L, bootprog_rev);
|
||||
lua_setfield(L, -2, "version");
|
||||
/* Set global printc to loader.printc */
|
||||
lua_register(L, "printc", lua_printc);
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user