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
42b66ef1
Commit
42b66ef1
authored
8 years ago
by
Ximin Luo
Browse files
Options
Downloads
Patches
Plain Diff
iso9660: better check instead of the hacky DOS/MBR thing
parent
3b6050bf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
diffoscope/comparators/iso9660.py
+13
-1
13 additions, 1 deletion
diffoscope/comparators/iso9660.py
with
13 additions
and
1 deletion
diffoscope/comparators/iso9660.py
+
13
−
1
View file @
42b66ef1
...
...
@@ -69,7 +69,19 @@ class ISO9660Listing(Command):
class
Iso9660File
(
File
):
CONTAINER_CLASS
=
LibarchiveContainer
RE_FILE_TYPE
=
re
.
compile
(
r
'
\b(ISO 9660|DOS/MBR boot sector)\b
'
)
RE_FILE_TYPE
=
re
.
compile
(
r
'
\bISO 9660\b
'
)
@classmethod
def
recognizes
(
cls
,
file
):
if
file
.
magic_file_type
and
cls
.
RE_FILE_TYPE
.
search
(
file
.
magic_file_type
):
return
True
else
:
# sometimes CDs put things like MBRs at the front, which is an expected
# part of the ISO9660 standard, but file(1)/libmagic doesn't detect this
# see https://en.wikipedia.org/wiki/ISO_9660#Specifications for detais
with
open
(
file
.
path
,
"
rb
"
)
as
fp
:
fp
.
seek
(
32769
)
return
fp
.
read
(
5
)
==
b
'
CD001
'
def
compare_details
(
self
,
other
,
source
=
None
):
differences
=
[]
...
...
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