You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
709 B
28 lines
709 B
--
|
|
-- SPM Bootstrap Installer
|
|
-- Minimal functionality to install pull SPM and install itself.
|
|
--
|
|
component = require("component")
|
|
fs = require("filesystem")
|
|
wget = loadfile("/bin/wget.lua")
|
|
|
|
if not component.isAvailable("internet")
|
|
io.stderr\write("This program requires an internet card to run.")
|
|
return
|
|
|
|
downloadSrc = "{URL_BASE}/spm/spm.min.lua"
|
|
saveLocation = "/tmp/spm.lua"
|
|
|
|
print("Downloading Temporary SPM")
|
|
wget("-qf", downloadSrc, saveLocation)
|
|
|
|
spm = loadfile(saveLocation)
|
|
|
|
print("Installing SPM Locally")
|
|
spm("install", "-f", "spm")
|
|
|
|
print("Removing Temporary SPM")
|
|
fs.remove(saveLocation)
|
|
print("Removing bootstrap.lua")
|
|
fs.remove(debug.getinfo(2, "S").source\sub(2))
|
|
print("Done")
|