v1.1.0 - Added resolution to fetch, fixed battery display in fetch, fixed ag update and made it safer, fixed a bug in argentum.cfg.
This commit is contained in:
@@ -4,7 +4,7 @@ A universal, customizable and feature-packed operating system for OpenComputers.
|
||||
## Installation
|
||||
To install Halyde from OpenOS, simply run:
|
||||
|
||||
`pastebin run 3RU3Z303`
|
||||
`pastebin run nxP2zudb`
|
||||
|
||||
If for some reason that doesn't work, try:
|
||||
|
||||
|
||||
+1
-2
@@ -1,7 +1,7 @@
|
||||
local agcfg = {
|
||||
["halyde"] = {
|
||||
["maindir"] = "",
|
||||
["version"] = "1.0.3",
|
||||
["version"] = "1.1.0",
|
||||
["description"] = "A universal, customizable and feature-packed operating system for OpenComputers.",
|
||||
["directories"] = {
|
||||
"halyde/apps",
|
||||
@@ -29,7 +29,6 @@ local agcfg = {
|
||||
"halyde/apps/cd.lua",
|
||||
"halyde/apps/clear.lua",
|
||||
"halyde/apps/cp.lua",
|
||||
"halyde/apps/download.lua",
|
||||
"halyde/apps/echo.lua",
|
||||
"halyde/apps/fetch.lua",
|
||||
"halyde/apps/help.lua",
|
||||
|
||||
+37
-11
@@ -125,7 +125,10 @@ local function doChecks(package)
|
||||
return true
|
||||
end
|
||||
|
||||
local function installPackage(package)
|
||||
local function installPackage(package, overwriteFlag)
|
||||
if not overwriteFlag then
|
||||
overwriteFlag = false
|
||||
end
|
||||
print("Installing " .. package .. "...")
|
||||
local agcfg = getAgConfig(package, source)
|
||||
if not agcfg then
|
||||
@@ -176,7 +179,7 @@ local function installPackage(package)
|
||||
goto retry
|
||||
end
|
||||
end
|
||||
if fs.exists(file) then
|
||||
if fs.exists(file) and not overwriteFlag then
|
||||
if not fs.exists("/argentum/store/" .. package .. "/files/" .. file:match("(.*/)")) then
|
||||
fs.makeDirectory("/argentum/store/" .. package .. "/files/" .. file:match("(.*/)"))
|
||||
end
|
||||
@@ -255,7 +258,37 @@ local function removePackage(package)
|
||||
return true
|
||||
end
|
||||
|
||||
-- Update registry
|
||||
local function updatePackage(package)
|
||||
print("Updating " .. package .. "...")
|
||||
local agcfg = getAgConfig(package, source)
|
||||
if not agcfg then
|
||||
return false
|
||||
end
|
||||
local handle, data, tmpdata = fs.open("/argentum/store/" .. package .. "/package.cfg", "r"), "", nil
|
||||
repeat
|
||||
tmpdata = handle:read(math.huge)
|
||||
data = data .. (tmpdata or "")
|
||||
until not tmpdata
|
||||
handle:close()
|
||||
local oldFiles = {}
|
||||
for line in (data .. "\n"):gmatch("(.-)\n") do
|
||||
if agcfg[package].directories then
|
||||
if not table.find(agcfg[package].files, line:sub(2)) and not table.find(agcfg[package].directories, line:sub(2, -2)) then
|
||||
table.insert(oldFiles, line:sub(2))
|
||||
end
|
||||
else
|
||||
if not table.find(agcfg[package].files, line:sub(2)) then
|
||||
table.insert(oldFiles, line:sub(2))
|
||||
end
|
||||
end
|
||||
end
|
||||
for _, oldFile in pairs(oldFiles) do
|
||||
print(" Removing " .. oldFile .. "...")
|
||||
end
|
||||
return installPackage(package, true)
|
||||
end
|
||||
|
||||
-- update registry
|
||||
local fails = {}
|
||||
if command == "install" then
|
||||
if not packages or not packages[1] then
|
||||
@@ -330,7 +363,6 @@ elseif command == "remove" then
|
||||
i = i - 1
|
||||
elseif packages[i] == "argentum" then
|
||||
print("\27[91mFor obvious reasons, you can't uninstall Argentum.")
|
||||
print("\27[91mFor obvious reasons, you can't uninstall Halyde.")
|
||||
table.insert(fails, packages[i])
|
||||
table.remove(packageList, table.find(packageList, packages[i]))
|
||||
table.remove(packages, table.find(packages, packages[i]))
|
||||
@@ -482,13 +514,7 @@ elseif command == "update" then
|
||||
print(package .. " is up to date")
|
||||
goto skip
|
||||
end
|
||||
if not removePackage(package) then
|
||||
table.insert(fails, packages[i])
|
||||
table.remove(packageList, table.find(packageList, packages[i]))
|
||||
table.remove(packages, table.find(packages, packages[i]))
|
||||
goto skip
|
||||
end
|
||||
if not installPackage(package) then
|
||||
if not updatePackage(package) then
|
||||
table.insert(fails, packages[i])
|
||||
table.remove(packageList, table.find(packageList, packages[i]))
|
||||
table.remove(packages, table.find(packages, packages[i]))
|
||||
|
||||
@@ -62,7 +62,10 @@ elseif convert(usedDisk, "B", "KiB") >= 1 then
|
||||
else
|
||||
usedDiskString = tostring(usedDisk) .. " B"
|
||||
end
|
||||
print("\27[92mDisk\27[0m: "..usedDiskString.." / "..totalDiskString.."\n")
|
||||
print("\27[92mDisk\27[0m: "..usedDiskString.." / "..totalDiskString)
|
||||
termlib.cursorPosX = 17
|
||||
local width, height = component.invoke(component.list("gpu")(), "getResolution")
|
||||
print("\27[92mResolution\27[0m: "..tostring(width).."x"..tostring(height).."\n")
|
||||
termlib.cursorPosX = 17
|
||||
print("\27[40m \27[41m \27[42m \27[43m \27[44m \27[45m \27[46m \27[47m ")
|
||||
termlib.cursorPosX = 17
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
local loadfile = ...
|
||||
local filesystem = loadfile("/halyde/lib/filesystem.lua")(loadfile)
|
||||
|
||||
_G._OSVERSION = "Halyde 1.0.3"
|
||||
_G._OSVERSION = "Halyde 1.1.0"
|
||||
|
||||
function _G.import(module, ...)
|
||||
local args = table.pack(...)
|
||||
|
||||
@@ -6,6 +6,7 @@ end
|
||||
local internet = component.internet
|
||||
local computer = require("computer")
|
||||
local fs = require("filesystem")
|
||||
local gpu = component.gpu
|
||||
local installLocation
|
||||
local drives = {}
|
||||
for drive in fs.list("/mnt/") do
|
||||
@@ -27,6 +28,9 @@ else
|
||||
else
|
||||
installDrivesText = installDrivesText .. "\n " .. tostring(i) .. ". - " .. address:sub(1, 5) .. "..."
|
||||
end
|
||||
else
|
||||
table.remove(drives, i)
|
||||
i = i - 1
|
||||
end
|
||||
end
|
||||
io.write(installDrivesText .. "\nPlease select a drive by entering its number or \"q\" to quit. ")
|
||||
|
||||
Reference in New Issue
Block a user