First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 105127
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Default Assignee for Orphaned Packages <maintainer-needed@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Erik Thiele <erik@thiele-hydraulik.de>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
105127-r2.patch Patch to fix anytopnm patch Matthew Lange 2005-09-11 21:02 0000 1.56 KB Details | Diff
netpbm-10.28-r1.ebuild media-libs/netpbm ebuild text/plain Matthew Lange 2005-09-11 21:04 0000 2.44 KB Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 105127 depends on: Show dependency tree
Show dependency graph
Bug 105127 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-09-07 02:43 0000
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:

------- Comment #1 From Jakub Moc 2005-09-07 02:44:47 0000 -------
Please, *always* include ebuild name and version in the bug summary. Otherwise,
I cannot assign the bug.

------- Comment #2 From Erik Thiele 2005-09-07 03:56:37 0000 -------
*  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


------- Comment #3 From Jakub Moc 2005-09-07 04:08:29 0000 -------
You forgot to reopen.

------- Comment #4 From Matthew Lange 2005-09-11 21:02:36 0000 -------
Created an attachment (id=68221) [edit]
Patch to fix anytopnm

Patch to fix anytopnm.	Compiles and works fine on my box.  Ebuild to follow.

------- Comment #5 From Matthew Lange 2005-09-11 21:04:08 0000 -------
Created an attachment (id=68222) [edit]
media-libs/netpbm ebuild

Ebuild that works with 105127-r2.patch

------- Comment #6 From SpanKY 2005-09-26 18:13:52 0000 -------
thanks, patch now in 10.29-r1

First Last Prev Next    No search results available      Search page      Enter new bug