forked from Hyperion/HyperionOS
fixed again
This commit is contained in:
@@ -8,12 +8,13 @@ print("Installing HyperionOS...")
|
||||
print("Installing precompiled tar")
|
||||
shell.run("wget https://git.astronand.dev/Hyperion/HyperionOS/raw/tag/"..release.."/misc/cct/installdata/Build.tar /Build.tar")
|
||||
shell.run("tar Build.tar /")
|
||||
sleep(1)
|
||||
print("Removing tar but bad...")
|
||||
shell.run("rm /tar.lua")
|
||||
shell.run("rm $")
|
||||
shell.run("rm Build.tar")
|
||||
shell.run("cp Build $")
|
||||
shell.run("rm Build")
|
||||
shell.run("rm Build.tar")
|
||||
fs.copy("/$/boot/cct/eeprom","/startup.lua")
|
||||
print("Installing...")
|
||||
sleep(1)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
local function octal_to_number(str)
|
||||
str = str:gsub("%z", ""):match("^%s*(.-)%s*$")
|
||||
return tonumber(str, 8) or 0
|
||||
@@ -97,30 +98,29 @@ local function unpack_tar(tarstr)
|
||||
local pad = (512 - (size % 512)) % 512
|
||||
i = i + size + pad
|
||||
|
||||
if name ~= "" then
|
||||
if name == "" then goto continue end
|
||||
|
||||
local is_dir = typeflag == "5" or name:sub(-1) == "/"
|
||||
local clean_name = name:gsub("/$", "")
|
||||
|
||||
if clean_name ~= "" then
|
||||
local is_dir = typeflag == "5" or name:sub(-1) == "/"
|
||||
|
||||
local parent_path = clean_name:match("(.+)/")
|
||||
local fname = clean_name:match("([^/]+)$")
|
||||
if not fname then
|
||||
local clean_name = name:gsub("/$", "")
|
||||
if clean_name == "" then goto continue end
|
||||
|
||||
local parent = root
|
||||
if parent_path then
|
||||
parent = make_dirs(root, parent_path .. "/")
|
||||
end
|
||||
|
||||
if is_dir then
|
||||
parent[fname] = parent[fname] or { __type = "dir", __entries = {} }
|
||||
else
|
||||
parent[fname] = { __type = "file", __contents = contents }
|
||||
end
|
||||
end
|
||||
end
|
||||
local parent_path = clean_name:match("(.+)/")
|
||||
local fname = clean_name:match("([^/]+)$")
|
||||
if not fname then goto continue end
|
||||
|
||||
local parent = root
|
||||
if parent_path then
|
||||
parent = make_dirs(root, parent_path .. "/")
|
||||
end
|
||||
|
||||
if is_dir then
|
||||
parent[fname] = parent[fname] or { __type = "dir", __entries = {} }
|
||||
else
|
||||
parent[fname] = { __type = "file", __contents = contents }
|
||||
end
|
||||
|
||||
::continue::
|
||||
end
|
||||
|
||||
return flatten(root)
|
||||
|
||||
Reference in New Issue
Block a user