made repoinstaller cope with external files reasonably
This commit is contained in:
parent
b68f1ad9e1
commit
7a48f1a27f
@ -28,9 +28,15 @@ end
|
|||||||
|
|
||||||
for k,v in pairs(dlfiles) do
|
for k,v in pairs(dlfiles) do
|
||||||
local path,fn = v:match("(.+)/(.+)")
|
local path,fn = v:match("(.+)/(.+)")
|
||||||
os.execute("mkdir "..dest..path)
|
if v:sub(1,4) ~= "http" then
|
||||||
os.execute("wget "..pathpre..v.." -O "..dest..v)
|
os.execute("mkdir -p "..dest..path)
|
||||||
print("wget "..pathpre..v.." -O "..dest..v)
|
os.execute("wget "..pathpre..v.." -O "..dest..v)
|
||||||
|
print("wget "..pathpre..v.." -O "..dest..v..">/dev/null")
|
||||||
|
else
|
||||||
|
os.execute("mkdir -p "..dest.."/external")
|
||||||
|
print("wget "..v.." -O "..dest.."/external/"..v)
|
||||||
|
os.execute("wget "..v.." -O "..dest.."/external/"..fn.."> /dev/null")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
os.execute("wget https://git.shadowkat.net/izaya/OC-misc/raw/branch/master/repo-installer/repoinstaller.lua "..dest.."/.install")
|
os.execute("wget https://git.shadowkat.net/izaya/OC-misc/raw/branch/master/repo-installer/repoinstaller.lua -O "..dest.."/.install")
|
||||||
|
@ -190,14 +190,22 @@ local function install(pkg,where) -- installs a package, pkg, to where
|
|||||||
if m:sub(1,2) ~= "//" then
|
if m:sub(1,2) ~= "//" then
|
||||||
if not fs.exists(fs.canonical(where.."/"..m)) then
|
if not fs.exists(fs.canonical(where.."/"..m)) then
|
||||||
os.execute("mkdir "..fs.canonical(where.."/"..m))
|
os.execute("mkdir "..fs.canonical(where.."/"..m))
|
||||||
end
|
end
|
||||||
os.execute("cp -v "..rpath.."/"..l.." "..fs.canonical(where.."/"..m))
|
if l:sub(1,4) == "http" then
|
||||||
|
os.execute("cp -v "..rpath.."/external/"..l:match(".+/(.+)").." "..fs.canonical(where.."/"..m))
|
||||||
|
else
|
||||||
|
os.execute("cp -v "..rpath.."/"..l.." "..fs.canonical(where.."/"..m))
|
||||||
|
end
|
||||||
ipackages[pkg][l] = fs.canonical(where.."/"..m).."/"..lseg[#lseg]
|
ipackages[pkg][l] = fs.canonical(where.."/"..m).."/"..lseg[#lseg]
|
||||||
else
|
else
|
||||||
if not fs.exists(fs.canonical(m:sub(2))) then
|
if not fs.exists(fs.canonical(m:sub(2))) then
|
||||||
os.execute("mkdir "..fs.canonical(m:sub(2)))
|
os.execute("mkdir "..fs.canonical(m:sub(2)))
|
||||||
end
|
end
|
||||||
os.execute("cp -v "..rpath.."/"..l.." "..fs.canonical(m:sub(2)))
|
if l:sub(1,4) == "http" then
|
||||||
|
os.execute("cp -v "..rpath.."/external/"..l:match(".+/(.+)").." "..fs.canonical(where.."/"..m))
|
||||||
|
else
|
||||||
|
os.execute("cp -v "..rpath.."/"..l.." "..fs.canonical(where.."/"..m))
|
||||||
|
end
|
||||||
ipackages[pkg][l] = fs.canonical(m:sub(2)).."/"..lseg[#lseg]
|
ipackages[pkg][l] = fs.canonical(m:sub(2)).."/"..lseg[#lseg]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user