summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-02-14 02:43:28 +0000
committerMike Frysinger <vapier@gentoo.org>2009-02-14 02:43:28 +0000
commit3c780608b187260771329354fcd9bbf365a936ba (patch)
tree97fe3d8897c2750b38272239d936df2214593b8b /sys-apps/file
parentAdd in dependency on x11-libs/libgksu thanks to Jeff Mitchell, bug 258621. (diff)
downloadgentoo-2-3c780608b187260771329354fcd9bbf365a936ba.tar.gz
gentoo-2-3c780608b187260771329354fcd9bbf365a936ba.tar.bz2
gentoo-2-3c780608b187260771329354fcd9bbf365a936ba.zip
Add fix from upstream for unicode issue #258452 by MarisN. Move data files to /usr/share/misc/ #246769 by Ulrich Müller.
(Portage version: 2.2_rc23/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/file')
-rw-r--r--sys-apps/file/ChangeLog9
-rw-r--r--sys-apps/file/file-5.00-r1.ebuild61
-rw-r--r--sys-apps/file/files/file-5.00-localization.patch80
3 files changed, 149 insertions, 1 deletions
diff --git a/sys-apps/file/ChangeLog b/sys-apps/file/ChangeLog
index 6427cadfc47f..f1d1803287fa 100644
--- a/sys-apps/file/ChangeLog
+++ b/sys-apps/file/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-apps/file
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/file/ChangeLog,v 1.164 2009/02/04 00:17:11 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/file/ChangeLog,v 1.165 2009/02/14 02:43:28 vapier Exp $
+
+*file-5.00-r1 (14 Feb 2009)
+
+ 14 Feb 2009; Mike Frysinger <vapier@gentoo.org>
+ +files/file-5.00-localization.patch, +file-5.00-r1.ebuild:
+ Add fix from upstream for unicode issue #258452 by MarisN. Move data files
+ to /usr/share/misc/ #246769 by Ulrich Müller.
*file-5.00 (04 Feb 2009)
diff --git a/sys-apps/file/file-5.00-r1.ebuild b/sys-apps/file/file-5.00-r1.ebuild
new file mode 100644
index 000000000000..7879ba4fd54f
--- /dev/null
+++ b/sys-apps/file/file-5.00-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/file/file-5.00-r1.ebuild,v 1.1 2009/02/14 02:43:28 vapier Exp $
+
+inherit eutils distutils libtool flag-o-matic
+
+DESCRIPTION="identify a file's format by scanning binary data for patterns"
+HOMEPAGE="ftp://ftp.astron.com/pub/file/"
+SRC_URI="ftp://ftp.astron.com/pub/file/${P}.tar.gz
+ ftp://ftp.gw.com/mirrors/pub/unix/file/${P}.tar.gz"
+
+LICENSE="as-is"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+IUSE="python"
+
+DEPEND=""
+
+src_unpack() {
+ unpack ${P}.tar.gz
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${PN}-4.15-libtool.patch #99593
+ epatch "${FILESDIR}"/${P}-localization.patch #258452
+
+ elibtoolize
+ epunt_cxx
+
+ # make sure python links against the current libmagic #54401
+ sed -i "/library_dirs/s:'\.\./src':'../src/.libs':" python/setup.py
+ # dont let python README kill main README #60043
+ mv python/README{,.python}
+
+ # only one data file, so put it into /usr/share/misc/
+ sed -i '/^pkgdatadir/s:/@PACKAGE@::' $(find -name Makefile.in)
+}
+
+src_compile() {
+ # file uses things like strndup() and wcwidth()
+ append-flags -D_GNU_SOURCE
+
+ econf --datadir=/usr/share/misc || die
+ emake || die "emake failed"
+
+ use python && cd python && distutils_src_compile
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+ dodoc ChangeLog MAINT README
+
+ use python && cd python && distutils_src_install
+}
+
+pkg_postinst() {
+ use python && distutils_pkg_postinst
+}
+
+pkg_postrm() {
+ use python && distutils_pkg_postrm
+}
diff --git a/sys-apps/file/files/file-5.00-localization.patch b/sys-apps/file/files/file-5.00-localization.patch
new file mode 100644
index 000000000000..f598c15084a3
--- /dev/null
+++ b/sys-apps/file/files/file-5.00-localization.patch
@@ -0,0 +1,80 @@
+http://bugs.gentoo.org/258452
+
+From: christos@zoulas.com (Christos Zoulas)
+To: file@mx.gw.com
+Date: Fri, 13 Feb 2009 13:46:12 -0500
+Subject: Re: file 5.00 error with a French .doc file
+
+On Feb 12, 5:05am, dnovotny@redhat.com (Daniel Novotny) wrote:
+-- Subject: file 5.00 error with a French .doc file
+
+|
+| ------=_Part_10359_582458326.1234433130940
+| Content-Type: text/plain; charset=utf-8
+| Content-Transfer-Encoding: 7bit
+|
+| hello,
+|
+| the new file 5.00 returns error exit code for a .DOC file:
+|
+| $ file ~/Download/PMD.doc
+| /home/pmatilai/Download/PMD.doc: ERROR: CDF V2 Document, Little Endian, Os:
+| Windows, Version 5.1, Code page: 1252vasprintf failed (Invalid or incomplete
+| multibyte or wide character)
+|
+| I am attaching the file for analysis
+|
+| (btw this corrupts rpmbuild process, which checks every file it packs)
+|
+| best regards,
+
+$ file -m ../magic/magic.mgc PMD.doc
+PMD.doc: CDF V2 Document, Little Endian, Os: Windows, Version 5.1, Code page: 1252, Title: \225, Subject: , Author: Bekrar, Keywords: , Comments: , Template: Normal.dot, Last Saved By: Bekrar, Revision Number: 2, Name of Creating Application: Microsoft Office Word, Total Editing Time: 01:00, Create Time/Date: Mon Aug 15 10:51:00 2005, Last Saved Time/Date: Mon Aug 15 11:02:00 2005, Number of Pages: 2, Number of Words: 646, Number of Characters: 3555, Security: 0
+
+It must be the \225 character. Since we don't handle localization, I will
+just eat the bad strings. Here is the output after the change:
+
+PMD.doc: CDF V2 Document, Little Endian, Os: Windows, Version 5.1, Code page: 1252, Author: Bekrar, Template: Normal.dot, Last Saved By: Bekrar, Revision Number: 2, Name of Creating Application: Microsoft Office Word, Total Editing Time: 01:00, Create Time/Date: Mon Aug 15 10:51:00 2005, Last Saved Time/Date: Mon Aug 15 11:02:00 2005, Number of Pages: 2, Number of Words: 646, Number of Characters: 3555, Security: 0
+
+
+Index: readcdf.c
+===================================================================
+RCS file: /p/file/cvsroot/file/src/readcdf.c,v
+retrieving revision 1.11
+diff -u -u -r1.11 readcdf.c
+--- src/readcdf.c 3 Feb 2009 20:27:51 -0000 1.11
++++ src/readcdf.c 13 Feb 2009 18:45:33 -0000
+@@ -75,9 +75,23 @@
+ if (len > 1) {
+ s = info[i].pi_str.s_buf;
+ if (NOTMIME(ms)) {
+- if (file_printf(ms, ", %s: %.*s", buf,
+- len, s) == -1)
+- return -1;
++ char vbuf[1024];
++ size_t j;
++ for (j = 0; j < sizeof(vbuf) && len--;
++ j++, s++) {
++ if (*s == '\0')
++ break;
++ if (isprint((unsigned char)*s))
++ vbuf[j] = *s;
++ }
++ if (j == sizeof(vbuf))
++ --j;
++ vbuf[j] = '\0';
++ if (vbuf[0]) {
++ if (file_printf(ms, ", %s: %s",
++ buf, vbuf) == -1)
++ return -1;
++ }
+ } else if (info[i].pi_id ==
+ CDF_PROPERTY_NAME_OF_APPLICATION) {
+ if (strstr(s, "Word"))
+
+christos
+
+_______________________________________________
+File mailing list
+File@mx.gw.com
+http://mx.gw.com/mailman/listinfo/file