[arch-commits] Commit in diffoscope/trunk (PKGBUILD sqlite-magic.patch)
Levente Polyak
anthraxx at archlinux.org
Fri Jun 17 17:27:50 UTC 2016
Date: Friday, June 17, 2016 @ 17:27:50
Author: anthraxx
Revision: 180377
upgpkg: diffoscope 54-1
- adding file magic patch that broke sqlite check
Added:
diffoscope/trunk/sqlite-magic.patch
Modified:
diffoscope/trunk/PKGBUILD
--------------------+
PKGBUILD | 9 ++++++---
sqlite-magic.patch | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2016-06-17 17:20:05 UTC (rev 180376)
+++ PKGBUILD 2016-06-17 17:27:50 UTC (rev 180377)
@@ -1,7 +1,7 @@
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
pkgname=diffoscope
-pkgver=52
+pkgver=54
pkgrel=1
pkgdesc='Tool for in-depth comparison of files, archives, and directories'
url='https://diffoscope.org/'
@@ -41,12 +41,15 @@
checkdepends=(
'python-pytest' 'acl' 'binutils' 'bzip2' 'cdrkit' 'colord' 'cpio' 'diffutils' 'e2fsprogs' 'enjarify' 'java-environment>=8' 'fontforge' 'gettext' 'ghc' 'gnupg'
'mono-tools' 'poppler' 'sqlite' 'squashfs-tools' 'tlsh' 'unzip' 'gzip' 'tar' 'vim' 'xz')
-source=(${pkgname}-${pkgver}.tar.xz::https://anonscm.debian.org/cgit/reproducible/${pkgname}.git/snapshot/${pkgname}-${pkgver}.tar.xz)
-sha512sums=('809a5e86860325e47ede97caf12f60f6048185b986c5a1792574aca1b79f86caf5f66441264dc048b2f8be0bc53b755950b77edaf6e54aedf6f553d54c4988b7')
+source=(${pkgname}-${pkgver}.tar.xz::https://anonscm.debian.org/cgit/reproducible/${pkgname}.git/snapshot/${pkgname}-${pkgver}.tar.xz
+ sqlite-magic.patch)
+sha512sums=('8adbff01652243954aa47f404057f600567d46d0265cdc22f2d9c33740de1b64ff2cb238d147649598488c955637df0b9a1b57a2965686f86d9d2712b38c17eb'
+ '3450c114f01a223c968fa75d230321fa188eae81146a2aad36b095a3ce96332167c638a46458c032343adaabc245555fd0f1fc7bd5e9ec26ff26c9cdd534ab23')
prepare() {
cd ${pkgname}-${pkgver}
sed '/python-magic/d' -i setup.py
+ patch -p1 < "${srcdir}/sqlite-magic.patch"
}
build() {
Added: sqlite-magic.patch
===================================================================
--- sqlite-magic.patch (rev 0)
+++ sqlite-magic.patch 2016-06-17 17:27:50 UTC (rev 180377)
@@ -0,0 +1,34 @@
+From 9dd11793b1b1bf0c742ed8e73484e37d772a4aeb Mon Sep 17 00:00:00 2001
+From: anthraxx <levente at leventepolyak.net>
+Date: Mon, 6 Jun 2016 20:23:14 +0200
+Subject: [PATCH] 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)]
+--
+2.8.3
+
More information about the arch-commits
mailing list