From 7bf0e6c3b244f142aedc46f38d36099f4c0db7f0ce856044e0ac5067697823bf Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 19 Apr 2016 11:50:56 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/file?expand=0&rev=130 --- file-5.26-console.diff | 11 +++++++++++ file-5.26-zmagic.patch | 41 +++++++++++++++++++++++++++++++++++++++++ file.changes | 6 ++++++ file.spec | 5 ++++- 4 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 file-5.26-console.diff create mode 100644 file-5.26-zmagic.patch diff --git a/file-5.26-console.diff b/file-5.26-console.diff new file mode 100644 index 0000000..534d370 --- /dev/null +++ b/file-5.26-console.diff @@ -0,0 +1,11 @@ +--- file-5.26/magic/Magdir/console.old 2016-03-23 16:29:20.000000000 +0100 ++++ file-5.26/magic/Magdir/console 2016-04-18 21:33:02.279350392 +0200 +@@ -53,7 +53,7 @@ + # so most of the data isn't easily parseable. + # + 0 string UNIF +-4 lelong <16 UNIF v%d format NES ROM image ++>4 lelong <16 UNIF v%d format NES ROM image + + #------------------------------------------------------------------------------ + # gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format diff --git a/file-5.26-zmagic.patch b/file-5.26-zmagic.patch new file mode 100644 index 0000000..f98e5fc --- /dev/null +++ b/file-5.26-zmagic.patch @@ -0,0 +1,41 @@ +--- + src/compress.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +--- file-5.26/src/compress.c ++++ file-5.26/src/compress.c 2016-04-19 11:44:03.297654887 +0200 +@@ -231,9 +231,9 @@ file_zmagic(struct magic_set *ms, int fd + goto error; + DPRINTF("rv = %d\n", rv); + if ((ms->flags & MAGIC_COMPRESS_TRANSP) != 0) +- goto out; ++ break; + if (mime != MAGIC_MIME && mime != 0) +- goto out; ++ break; + if ((file_printf(ms, + mime ? " compressed-encoding=" : " (")) == -1) + goto error; +@@ -250,16 +250,16 @@ file_zmagic(struct magic_set *ms, int fd + } + if (!mime && file_printf(ms, ")") == -1) + goto error; +- goto out; + case NODATA: +- goto out; ++ break; + default: +- abort(); ++ error: ++ rv = -1; ++ break; + } + } +-out: +- rv = 1; +-error: ++ DPRINTF("rv = %d\n", rv); ++ + #ifdef HAVE_SIGNAL_H + (void)signal(SIGPIPE, osigpipe); + #endif diff --git a/file.changes b/file.changes index f23b778..5c159f3 100644 --- a/file.changes +++ b/file.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Apr 19 09:38:07 UTC 2016 - werner@suse.de + +- Add upstream patch file-5.26-console.diff + to fix wrong detection of UNIF edb files + ------------------------------------------------------------------- Tue Apr 19 09:35:28 UTC 2016 - werner@suse.de diff --git a/file.spec b/file.spec index 034179a..17b5fef 100644 --- a/file.spec +++ b/file.spec @@ -65,6 +65,8 @@ Patch36: file-5.15-clear-invalid.patch Patch37: file-secure_getenv.patch Patch38: file-5.26-version.patch Patch39: file-5.26-downgrade_DER.patch +Patch40: file-5.26-console.diff +Patch40: file-5.26-zmagic.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _miscdir %{_datadir}/misc @@ -129,6 +131,8 @@ to develop applications that require the magic "file" interface. %patch37 -p1 -b .getenv %patch38 -p1 -b .php %patch39 -p0 -b .DER +%patch40 -p1 -b .cons +%patch41 -p1 -b .zmag %patch -b .0 test -s src/magic.h.in || cp -p src/magic.h src/magic.h.in rm -fv src/magic.h @@ -161,7 +165,6 @@ echo '# global magic file is %{_miscdir}/magic(.mgc)' >> %{buildroot}%{_sysc LD_LIBRARY_PATH=%{buildroot}%{_libdir} export LD_LIBRARY_PATH find %{buildroot}%{_bindir}/file %{_bindir}/ /%{_lib}/ %{_libdir}/ | \ - grep -v tests/data/bom.py | \ xargs %{buildroot}%{_bindir}/file -m %{buildroot}%{_miscdir}/magic unset LD_LIBRARY_PATH %{__rm} -f %{buildroot}%{_libdir}/*.la