Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mcmodder
oc-progs
Commits
e5d2600f
Commit
e5d2600f
authored
Dec 11, 2016
by
mcmodder
Browse files
Чот я как-то странно наговнокодил...
parent
b4ad584c
Pipeline
#101
passed with stage
in 24 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pacman.lua
View file @
e5d2600f
...
...
@@ -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
e
lseif
ops
.
flash
or
ops
.
F
the
n
getAllRepo
s
()
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
en
d
saveInstalledPackage
s
()
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment