Commit 6f57843d authored by anthraxx's avatar anthraxx Committed by Reiner Herrmann

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.
parent 5ad5998c
......@@ -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)]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment