Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
diffoscope
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reproducible Builds
diffoscope
Commits
b85e7852
Commit
b85e7852
authored
8 years ago
by
Maria Glukhova
Committed by
Chris Lamb
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove archive name from apktool.yml and rename it. (Closes: #850501)
Signed-off-by:
Chris Lamb
<
lamby@debian.org
>
parent
8bf8d351
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
diffoscope/comparators/apk.py
+16
-0
16 additions, 0 deletions
diffoscope/comparators/apk.py
with
16 additions
and
0 deletions
diffoscope/comparators/apk.py
+
16
−
0
View file @
b85e7852
...
...
@@ -31,6 +31,18 @@ from .utils.archive import Archive
logger
=
logging
.
getLogger
(
__name__
)
def
filter_apk_metadata
(
filepath
,
archive_name
):
new_filename
=
os
.
path
.
join
(
os
.
path
.
split
(
filepath
)[
0
],
"
APK metadata
"
)
logger
.
debug
(
"
Moving APK metadata from %s to %s
"
,
filepath
,
new_filename
)
with
open
(
filepath
)
as
f
:
with
open
(
new_filename
,
"
w
"
)
as
f_out
:
for
line
in
f
:
if
not
re
.
match
(
r
'
^apkFileName: %s
'
%
os
.
path
.
basename
(
archive_name
),
line
):
f_out
.
write
(
line
)
os
.
remove
(
filepath
)
return
new_filename
class
ApkContainer
(
Archive
):
@property
def
path
(
self
):
...
...
@@ -53,6 +65,10 @@ class ApkContainer(Archive):
for
root
,
_
,
files
in
os
.
walk
(
self
.
_unpacked
):
for
f
in
files
:
abspath
=
os
.
path
.
join
(
root
,
f
)
# apktool.yml is a file created by apktool and containing metadata information.
# Rename it to clarify.
if
os
.
path
.
basename
(
abspath
)
==
"
apktool.yml
"
:
abspath
=
filter_apk_metadata
(
abspath
,
os
.
path
.
basename
(
self
.
source
.
name
))
relpath
=
abspath
[
len
(
self
.
_unpacked
)
+
1
:]
self
.
_members
.
append
(
relpath
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment