Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
abuild
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
27
Issues
27
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
abuild
Commits
62d0c7b8
Commit
62d0c7b8
authored
Mar 31, 2014
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: remove cmp-apks-iso
its included with alpine-iso
parent
f9e5359f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
80 deletions
+0
-80
cmp-apks-iso
cmp-apks-iso
+0
-80
No files found.
cmp-apks-iso
deleted
100755 → 0
View file @
f9e5359f
#!/usr/bin/env lua
-- script to compare the packages versions in 2 iso images
-- usage: compare-apks
maxlen
=
0
function
read_package_list
(
file
)
local
a
=
{}
local
h
-- h = io.popen("tar -O -zxf ".. file.." -- apks/INDEX.md5.gz | gunzip -c | awk '{ print $2}'")
h
=
io.popen
(
"isoinfo -R -f -i "
..
file
..
" | grep '.apk$' | sed 's:.*/::'"
)
for
line
in
h
:
lines
()
do
p
,
v
=
string.match
(
line
,
"^(.+)-(%d.*).apk"
)
a
[
p
]
=
v
if
maxlen
<
#
p
+
#
v
+
2
then
maxlen
=
#
p
+
#
v
+
2
end
end
h
:
close
()
return
a
end
-- print all packages that exist in a1 but not in a2
function
missing_packages
(
a1
,
a2
)
local
ret
=
{}
local
p
,
v
for
p
,
v
in
pairs
(
a1
)
do
if
a2
[
p
]
==
nil
then
table.insert
(
ret
,
p
..
"-"
..
v
)
end
end
table.sort
(
ret
)
return
ret
end
function
unexpand_tabs
(
s
,
tab
)
tab
=
tab
or
8
local
pat
=
string.rep
(
"."
,
tab
)
s
=
string.gsub
(
s
,
pat
,
"%0\1"
)
s
=
string.gsub
(
s
,
" +\1"
,
"
\t
"
)
s
=
string.gsub
(
s
,
"
\1
"
,
""
)
return
s
end
function
upgraded_packages
(
a1
,
a2
)
local
p
,
v
,
tmp
local
a
=
{}
for
p
,
v
in
pairs
(
a2
)
do
if
a1
[
p
]
and
a1
[
p
]
~=
v
then
tmp
=
unexpand_tabs
(
string.format
(
"%-"
..
tostring
(
maxlen
)
..
"s(%s)"
,
p
..
"-"
..
v
,
a1
[
p
]))
table.insert
(
a
,
tmp
)
end
end
table.sort
(
a
)
return
a
end
apks1
=
read_package_list
(
arg
[
1
])
apks2
=
read_package_list
(
arg
[
2
])
print
(
"Removed packages:"
)
for
dummy
,
line
in
ipairs
(
missing_packages
(
apks1
,
apks2
))
do
print
(
line
)
end
print
(
"
\n
"
)
print
(
"New packages:"
)
for
dummy
,
line
in
ipairs
(
missing_packages
(
apks2
,
apks1
))
do
print
(
line
)
end
print
(
"
\n
"
)
print
(
"Upgraded/downgraded packages (from version):"
)
for
dummy
,
line
in
ipairs
(
upgraded_packages
(
apks1
,
apks2
))
do
print
(
line
)
end
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