Date: Thursday, June 14, 2018 @ 20:36:59 Author: anthraxx Revision: 343195
upgpkg: diffoscope 95-2 (fix python-libarchive-c >= 2.8) Added: diffoscope/trunk/fix-libarchive-2.8-compatibility.patch Modified: diffoscope/trunk/PKGBUILD ----------------------------------------+ PKGBUILD | 9 ++++++--- fix-libarchive-2.8-compatibility.patch | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2018-06-14 20:27:45 UTC (rev 343194) +++ PKGBUILD 2018-06-14 20:36:59 UTC (rev 343195) @@ -2,7 +2,7 @@ pkgname=diffoscope pkgver=95 -pkgrel=1 +pkgrel=2 pkgdesc='Tool for in-depth comparison of files, archives, and directories' url='https://diffoscope.org/' arch=('x86_64') @@ -57,12 +57,15 @@ 'java-environment>=8' 'fontforge' 'gettext' 'ghc' 'gnupg' 'mono' 'mono-tools' 'poppler' 'sqlite' 'squashfs-tools' 'tlsh' 'unzip' 'gzip' 'tar' 'tcpdump' 'vim' 'xz' 'llvm' 'colord' 'fpc' 'openssh' 'odt2txt' 'docx2txt' 'r' 'dtc' 'giflib' 'gnumeric' 'python-progressbar' 'binwalk' 'python-argcomplete') -source=(${pkgname}-${pkgver}.tar.bz2::https://salsa.debian.org/reproducible-builds/${pkgname}/-/archive/${pkgver}/${pkgname}-${pkgver}.tar.bz2) -sha512sums=('ad058e5691094ff06dcc71e1b715410b338e6973da59bd8d6076a9916d1afc29a868f5917752325189f9158d7cec910e8315d7a588b076014f83f67200a74441') +source=(${pkgname}-${pkgver}.tar.bz2::https://salsa.debian.org/reproducible-builds/${pkgname}/-/archive/${pkgver}/${pkgname}-${pkgver}.tar.bz2 + fix-libarchive-2.8-compatibility.patch) +sha512sums=('ad058e5691094ff06dcc71e1b715410b338e6973da59bd8d6076a9916d1afc29a868f5917752325189f9158d7cec910e8315d7a588b076014f83f67200a74441' + 'c5fb2c6149b9e50c80e9fd4cdb94f2ef6e90021b44aa98e940c2ca95c441a9dd36a642cd3df6abd646a10c9d6dbc8a8d08284e5299772c735bd029351068d366') prepare() { cd ${pkgname}-${pkgver} sed '/python-magic/d' -i setup.py + patch -p1 < ../fix-libarchive-2.8-compatibility.patch } build() { Added: fix-libarchive-2.8-compatibility.patch =================================================================== --- fix-libarchive-2.8-compatibility.patch (rev 0) +++ fix-libarchive-2.8-compatibility.patch 2018-06-14 20:36:59 UTC (rev 343195) @@ -0,0 +1,29 @@ +From 466be17181ba7b78006f982c5fa39a2397ffd748 Mon Sep 17 00:00:00 2001 +From: anthraxx <[email protected]> +Date: Thu, 14 Jun 2018 22:22:03 +0200 +Subject: [PATCH] libarchive: add compatibility with python-libarchive >= 2.8 + +Python librarchive 2.8 removed the mtime_nsec property from +ArchiveEntry so lets wire the ffi function if available +--- + diffoscope/comparators/utils/libarchive.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/diffoscope/comparators/utils/libarchive.py b/diffoscope/comparators/utils/libarchive.py +index f427ede..7bb20c0 100644 +--- a/diffoscope/comparators/utils/libarchive.py ++++ b/diffoscope/comparators/utils/libarchive.py +@@ -64,6 +64,10 @@ if not hasattr(libarchive.ffi, 'entry_uname'): + if not hasattr(libarchive.ffi, 'entry_gname'): + libarchive.ffi.ffi('entry_gname', [libarchive.ffi.c_archive_entry_p], ctypes.c_char_p) + libarchive.ArchiveEntry.gname = property(lambda self: libarchive.ffi.entry_gname(self._entry_p)) ++# Monkeypatch libarchive-c (<< 2.8) ++if not hasattr(libarchive.ArchiveEntry, 'mtime_nsec') and hasattr(libarchive.ffi, 'entry_mtime_nsec'): ++ libarchive.ArchiveEntry.mtime_nsec = property( ++ lambda self: libarchive.ffi.entry_mtime_nsec(self._entry_p)) + + # Monkeypatch libarchive-c so we always get pathname as (Unicode) str + # Otherwise, we'll get sometimes str and sometimes bytes and always pain. +-- +2.17.1 +
