Added build.compile and build.requirements to upgrade and install process [NEED TO BE TESTED ON LUA]
This commit is contained in:
		@@ -666,6 +666,7 @@ func Install(packagepath string, serial uint) error {
 | 
			
		||||
	defer L.Close()
 | 
			
		||||
 | 
			
		||||
	if !Unsafe {
 | 
			
		||||
		internal.SandboxDir = filepath.Join(cfg.Config.DataDir, name)
 | 
			
		||||
		osObject := L.GetGlobal("os").(*lua.LTable)
 | 
			
		||||
		ioObject := L.GetGlobal("io").(*lua.LTable)
 | 
			
		||||
 | 
			
		||||
@@ -679,6 +680,14 @@ func Install(packagepath string, serial uint) error {
 | 
			
		||||
 | 
			
		||||
		L.SetGlobal("path_join", L.NewFunction(internal.Ljoin))
 | 
			
		||||
 | 
			
		||||
		// Packets build functions
 | 
			
		||||
		build := L.NewTable()
 | 
			
		||||
 | 
			
		||||
		L.SetField(build, "requirements", L.NewFunction(internal.CompileRequirements))
 | 
			
		||||
		L.SetField(build, "compile", L.NewFunction(internal.LuaCompile))
 | 
			
		||||
 | 
			
		||||
		L.SetGlobal("build", build)
 | 
			
		||||
 | 
			
		||||
		osObject.RawSetString("execute", lua.LNil)
 | 
			
		||||
		osObject.RawSetString("exit", lua.LNil)
 | 
			
		||||
		osObject.RawSetString("getenv", lua.LNil)
 | 
			
		||||
@@ -1665,6 +1674,7 @@ func Upgrade(packagepath string, og_realname string, serial uint) error {
 | 
			
		||||
	defer L.Close()
 | 
			
		||||
 | 
			
		||||
	if !Unsafe {
 | 
			
		||||
		internal.SandboxDir = filepath.Join(cfg.Config.DataDir, name)
 | 
			
		||||
		osObject := L.GetGlobal("os").(*lua.LTable)
 | 
			
		||||
		ioObject := L.GetGlobal("io").(*lua.LTable)
 | 
			
		||||
 | 
			
		||||
@@ -1678,6 +1688,14 @@ func Upgrade(packagepath string, og_realname string, serial uint) error {
 | 
			
		||||
 | 
			
		||||
		L.SetGlobal("path_join", L.NewFunction(internal.Ljoin))
 | 
			
		||||
 | 
			
		||||
		// Packets build functions
 | 
			
		||||
		build := L.NewTable()
 | 
			
		||||
 | 
			
		||||
		L.SetField(build, "requirements", L.NewFunction(internal.CompileRequirements))
 | 
			
		||||
		L.SetField(build, "compile", L.NewFunction(internal.LuaCompile))
 | 
			
		||||
 | 
			
		||||
		L.SetGlobal("build", build)
 | 
			
		||||
 | 
			
		||||
		osObject.RawSetString("execute", lua.LNil)
 | 
			
		||||
		osObject.RawSetString("exit", lua.LNil)
 | 
			
		||||
		osObject.RawSetString("getenv", lua.LNil)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user