[arch-commits] Commit in file/trunk (01-fix-broken-xz.patch PKGBUILD)

Sébastien Luttringer seblu at archlinux.org
Thu Dec 11 20:50:05 UTC 2014


    Date: Thursday, December 11, 2014 @ 21:50:04
  Author: seblu
Revision: 227551

upgpkg: file 5.21-2

- fix FS#43078

Added:
  file/trunk/01-fix-broken-xz.patch
Modified:
  file/trunk/PKGBUILD

------------------------+
 01-fix-broken-xz.patch |   44 ++++++++++++++++++++++++++++++++++++++++++++
 PKGBUILD               |   13 ++++++++++---
 2 files changed, 54 insertions(+), 3 deletions(-)

Added: 01-fix-broken-xz.patch
===================================================================
--- 01-fix-broken-xz.patch	                        (rev 0)
+++ 01-fix-broken-xz.patch	2014-12-11 20:50:04 UTC (rev 227551)
@@ -0,0 +1,44 @@
+From abc95cd644418cc5205a8ad07d864f0851ac49df Mon Sep 17 00:00:00 2001
+From: Christos Zoulas <christos at zoulas.com>
+Date: Thu, 11 Dec 2014 11:47:08 +0000
+Subject: [PATCH] PR/405: file -bizL git-2.1.3.tar.xz broke because the xz
+ decompressor dies with SIGPIPE when we stop reading from it early. ignore
+ SIGPIPE>
+
+---
+ src/compress.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/compress.c b/src/compress.c
+index fa9e07a..bf93839 100644
+--- a/src/compress.c
++++ b/src/compress.c
+@@ -45,6 +45,7 @@ FILE_RCSID("@(#)$File: compress.c,v 1.74 2014/10/26 20:23:30 christos Exp $")
+ #endif
+ #include <string.h>
+ #include <errno.h>
++#include <signal.h>
+ #if !defined(__MINGW32__) && !defined(WIN32)
+ #include <sys/ioctl.h>
+ #endif
+@@ -103,10 +104,12 @@ file_zmagic(struct magic_set *ms, int fd, const char *name,
+ 	size_t i, nsz;
+ 	int rv = 0;
+ 	int mime = ms->flags & MAGIC_MIME;
++	sig_t osigpipe;
+ 
+ 	if ((ms->flags & MAGIC_COMPRESS) == 0)
+ 		return 0;
+ 
++	osigpipe = signal(SIGPIPE, SIG_IGN);
+ 	for (i = 0; i < ncompr; i++) {
+ 		if (nbytes < compr[i].maglen)
+ 			continue;
+@@ -133,6 +136,7 @@ file_zmagic(struct magic_set *ms, int fd, const char *name,
+ 		}
+ 	}
+ error:
++	(void)signal(SIGPIPE, osigpipe);
+ 	free(newbuf);
+ 	ms->flags |= MAGIC_COMPRESS;
+ 	return rv;

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-12-11 20:09:46 UTC (rev 227550)
+++ PKGBUILD	2014-12-11 20:50:04 UTC (rev 227551)
@@ -5,7 +5,7 @@
 
 pkgname=file
 pkgver=5.21
-pkgrel=1
+pkgrel=2
 pkgdesc='File type identification utility'
 arch=('i686' 'x86_64')
 license=('custom')
@@ -12,9 +12,16 @@
 groups=('base' 'base-devel')
 url='http://www.darwinsys.com/file/'
 depends=('glibc' 'zlib')
-source=("ftp://ftp.astron.com/pub/$pkgname/$pkgname-$pkgver.tar.gz")
-md5sums=('549fe96e09041eabece9de2bb28ef923')
+source=("ftp://ftp.astron.com/pub/$pkgname/$pkgname-$pkgver.tar.gz"
+        '01-fix-broken-xz.patch')
+md5sums=('549fe96e09041eabece9de2bb28ef923'
+         '62c8d81023e1705d8826d79d0a8fdaae')
 
+prepare() {
+  # https://bugs.archlinux.org/task/43078
+  patch -p1 -d $pkgname-$pkgver < '01-fix-broken-xz.patch'
+}
+
 build() {
   cd $pkgname-$pkgver
   ./configure --prefix=/usr --datadir=/usr/share/file



More information about the arch-commits mailing list