Commit e5d2600f authored by mcmodder's avatar mcmodder
Browse files

Чот я как-то странно наговнокодил...

parent b4ad584c
Pipeline #101 passed with stage
in 24 seconds
......@@ -255,6 +255,12 @@ local function searchForPackage( packageName )
return nil, appName
end
local function saveInstalledPackages()
local file = io.open("/etc/pacman/installedapps", "w")
file:write(seri.serialize(installed))
file:close()
end
--[[BEGIN]]
if ops.install or ops.I then
......@@ -288,9 +294,7 @@ if ops.install or ops.I then
end
end
local file = io.open("/etc/pacman/installedapps", "w")
file:write(seri.serialize(installed))
file:close()
saveInstalledPackages()
elseif ops.remove or ops.R then
getInstalledPackages()
for _, packageName in pairs(args) do
......@@ -303,9 +307,7 @@ elseif ops.remove or ops.R then
end
end
local file = io.open("/etc/pacman/installedapps", "w")
file:write(seri.serialize(installed))
file:close()
saveInstalledPackages()
elseif ops.search or ops.S then
getAllRepos()
getInstalledPackages()
......@@ -313,14 +315,11 @@ elseif ops.search or ops.S then
local success, packageName, repoName = searchForPackage(packageName)
if success==true then
downloadPackage(repoName, packageName)
saveInstalledPackages()
else
print("Nothing else found")
end
end
local file = io.open("/etc/pacman/installedapps", "w")
file:write(seri.serialize(installed))
file:close()
elseif ops.list or ops.L then
getAllRepos()
getInstalledPackages()
......@@ -380,22 +379,20 @@ elseif ops.update or ops.U then
end
end
end
elseif ops.flash or ops.F then
getAllRepos()
for _, packageName in pairs(args) do
if repos[ops.repo or "Default"] then
if repos[ops.repo or "Default"].apps[packageName] then
downloadEEPROMPackage( ops.repo or "Default", packageName)
else
print("No package \""..packageName.."\" found in repository "..(ops.repo or "Default"))
end
end
saveInstalledPackages()
elseif ops.flash or ops.F then
getAllRepos()
for _, packageName in pairs(args) do
if repos[ops.repo or "Default"] then
if repos[ops.repo or "Default"].apps[packageName] then
downloadEEPROMPackage( ops.repo or "Default", packageName)
else
print("No repo "..(ops.repo or "Default").." found")
print("No package \""..packageName.."\" found in repository "..(ops.repo or "Default"))
end
else
print("No repo "..(ops.repo or "Default").." found")
end
end
local file = io.open("/etc/pacman/installedapps", "w")
file:write(seri.serialize(installed))
file:close()
end
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment