mirror of
https://github.com/Kiritow/OpenComputerScripts.git
synced 2024-03-22 13:10:46 +08:00
Grab v2.5.1.2-alpha
Allow Grab to skip registry when it is unavailable.
This commit is contained in:
parent
7d71c4f160
commit
e9ec59db23
25
grab.lua
25
grab.lua
|
@ -9,7 +9,7 @@ local event=require('event')
|
|||
local term=require('term')
|
||||
local args,options=shell.parse(...)
|
||||
|
||||
local grab_version="Grab v2.5.1.1-alpha"
|
||||
local grab_version="Grab v2.5.1.2-alpha"
|
||||
local grab_infos={
|
||||
version=grab_version,
|
||||
grab_options=options
|
||||
|
@ -536,20 +536,25 @@ if(args[1]=="update") then
|
|||
|
||||
print("Checking package list version...")
|
||||
local ok,result=download("http://registry.kiritow.com/listver")
|
||||
local remoteURL
|
||||
local remoteVer
|
||||
|
||||
if(not ok) then
|
||||
print("[Failed] " .. result)
|
||||
return
|
||||
end
|
||||
print("[Skipped] Skipped package list version checking: " .. result)
|
||||
remoteURL=UrlGenerator('Kiritow/OpenComputerScripts','master','programs.info')
|
||||
remoteVer=nil
|
||||
else
|
||||
if(GetDBVersion()==result) then
|
||||
print("Already up to date.")
|
||||
return
|
||||
else
|
||||
remoteURL="http://registry.kiritow.com/list/" .. result
|
||||
remoteVer=result
|
||||
end
|
||||
end
|
||||
|
||||
local remoteVer=result
|
||||
|
||||
print("Updating package list....")
|
||||
io.write("Downloading... ")
|
||||
ok,result=download("http://registry.kiritow.com/list/" .. remoteVer)
|
||||
ok,result=download(remoteURL)
|
||||
if(not ok) then
|
||||
print("[Failed] " .. result)
|
||||
return
|
||||
|
@ -576,7 +581,11 @@ if(args[1]=="update") then
|
|||
end
|
||||
|
||||
print("Updating package list version...")
|
||||
if(remoteVer) then
|
||||
SaveDBVersion(remoteVer)
|
||||
else
|
||||
print("[Skipped] Not update from registry.")
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user