line 76 sais: mimeType=`file --mime "$1" | cut -d: -f2-` this is wrong. mimeType variable always contains a whitespace at first position. for example: mimeType=" image/png" for that reason the code in line 93 until 112 is never executed. it consists of commands like this: type = "jfif" this is not legal shell code! correct would be: type="jfif" (without whitespace) but due to the first bug, this wrong code is never executed. as i fixed the first bug the script bailed out at the second bug ;) isn't it strange that such an error can last for years without ever being noticed ;) never executed untested code.... :-) i found this bug, because i have a PNG image file with the following strange behaviour: erik@goofy:~/filebug$ file --mime 28 28: image/png erik@goofy:~/filebug$ file 28 28: Minix filesystem erik@goofy:~/filebug$ the file utility uses two different databases for mime output and human readable output. in the mime database there is no "minix file type" and in the human readable database there is a minix file type. unfortunately file gives favour for minix over png, but that is another discussion. anyway what anytopnm sais here is: erik@goofy:~/filebug$ anytopnm 28 /usr/bin/anytopnm: unknown file type. 'file' says mime type is ' image/png', type description is ' Minix filesystem' you see the whitespaces??? these whitespaces confuse anytopnm. normaly anytopnm would see that file --mime myfile returns image/png and just go on read the file. but the mime type is always ignored by the script due to the bug in the "cut" statement. instead the script ALWAYS uses the human readable description and in this case the human readable description is wrong, so the script fails. Reproducible: Always Steps to Reproduce:
Please, *always* include ebuild name and version in the bug summary. Otherwise, I cannot assign the bug.
* media-libs/netpbm Latest version available: 10.28 Latest version installed: 10.28 Size of downloaded files: 2,270 kB Homepage: http://netpbm.sourceforge.net/ Description: A set of utilities for converting to/from the netpbm (and related) formats License: GPL-2 root@gf:~# emerge info Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.3.6, glibc-2.3.5-r1, 2.6.12-gentoo-r10 i686) ================================================================= System uname: 2.6.12-gentoo-r10 i686 Intel(R) Pentium(R) 4 CPU 1.80GHz Gentoo Base System version 1.6.13 ccache version 2.3 [enabled] dev-lang/python: 2.3.5 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks nostrip sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" LANG="de_DE" LINGUAS="de" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 X alsa apm arts avi berkdb bitmap-fonts cdr crypt cups curl doc dvd eds emboss encode esd fam flac font-server foomaticdb fortran gd gdbm gif gimpprint gnome gphoto2 gpm gstreamer gtk gtk2 imagemagick imlib java jpeg kde ldap libg++ libwww mad mikmod motif mozilla mp3 mpeg ncurses nls ogg oggvorbis opengl oss pam pdflib perl png postgres ppds python qt quicktime readline samba scanner sdl slang spell ssl tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts usb vorbis xine xml2 xmms xv zlib linguas_de userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LC_ALL, LDFLAGS, PORTDIR_OVERLAY
You forgot to reopen.
Created attachment 68221 [details, diff] Patch to fix anytopnm Patch to fix anytopnm. Compiles and works fine on my box. Ebuild to follow.
Created attachment 68222 [details] media-libs/netpbm ebuild Ebuild that works with 105127-r2.patch
thanks, patch now in 10.29-r1