[diffoscope] 01/01: fix sqlite3 magic recognition when using file >= 5.27
Reiner Herrmann
reiner at reiner-h.de
Mon Jun 6 22:49:34 CEST 2016
This is an automated email from the git hooks/post-receive script.
deki-guest pushed a commit to branch master
in repository diffoscope.
commit 6f57843d88fa280abe3986db6fb3978fdb34d7c3
Author: anthraxx <levente at leventepolyak.net>
Date: Mon Jun 6 20:27:31 2016 +0200
fix sqlite3 magic recognition when using file >= 5.27
this fixes the recognition problems of sqlite3 as newer
file versions add additional information to the magic
recognition.
The new string is like:
SQLite 3.x database, last written using SQLite version 3008011
To be compatible with both, newer and older file versions we
check if the magic_file_type has any value and starts with the expected
recognition string.
---
diffoscope/comparators/sqlite.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/diffoscope/comparators/sqlite.py b/diffoscope/comparators/sqlite.py
index e361dea..16706d7 100644
--- a/diffoscope/comparators/sqlite.py
+++ b/diffoscope/comparators/sqlite.py
@@ -32,7 +32,7 @@ class Sqlite3Dump(Command):
class Sqlite3Database(File):
@staticmethod
def recognizes(file):
- return file.magic_file_type == 'SQLite 3.x database'
+ return file.magic_file_type and file.magic_file_type.startswith('SQLite 3.x database')
def compare_details(self, other, source=None):
return [Difference.from_command(Sqlite3Dump, self.path, other.path)]
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list