Bug 51991

Summary: JJ: magic python line too long
Product: [Applications] kdeprint Reporter: ccheney
Component: kdeprintfaxAssignee: KDEPrint Devel Mailinglist <kde-print-devel>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: grundleborg, jlayt
Priority: NOR Keywords: junior-jobs
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description ccheney 2002-12-16 23:21:16 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:          Linux

The magic file has a line that is too long causing file to complain.

The bad line is this:

0       string          eval\ "exec\ /usr/local/bin/python application/x-python

It causes file to output:

String too long: eval\ "exec\ /usr/local/bin/python application/x-python
Comment 1 David Faure 2002-12-17 15:49:16 UTC
Subject: Re:  New: magic python line too long

On Monday 16 December 2002 23:21, you wrote:
> The magic file has a line that is too long causing file to complain.
> 
> The bad line is this:
> 
> 0       string          eval\ "exec\ /usr/local/bin/python application/x-python
> 
> It causes file to output:
> 
> String too long: eval\ "exec\ /usr/local/bin/python application/x-python

Which magic file? KIO's ? It doesn't have the same format as the one used
by the "file" command, since we added mimetypes to it.
Are you trying to get "file" to use KIO's magic file??? 

Comment 2 Chris Cheney 2002-12-17 18:07:39 UTC
Subject: Re:  magic python line too long

On Tue, Dec 17, 2002 at 02:49:16PM -0000, David Faure wrote:
> > String too long: eval\ "exec\ /usr/local/bin/python application/x-python
> 
> Which magic file? KIO's ? It doesn't have the same format as the one used
> by the "file" command, since we added mimetypes to it.
> Are you trying to get "file" to use KIO's magic file???

Oh sorry I didn't fully explain where this warning is seen:

anytops in kdeprintfax has the following lines:

if [ -z "$MIMETYPE" ]; then
        MAGIC=$KDEDIR
        if [ -z "$MAGIC" ]; then
                MAGIC=/usr
        fi
        MAGIC=$MAGIC/share/mimelnk/magic

        if [ ! -f "$MAGIC" ]; then
                echo "KDE magic file not found. Check your installation."
                exit 1;
        fi

        MIMETYPE=`file -b -m $MAGIC "$INFILE" 2> /dev/null`
        MIMETYPE=${MIMETYPE%%;*}
fi


Chris

Comment 3 David Faure 2002-12-17 18:58:12 UTC
That's broken IMHO. This magic file isn't mean to be used by "file". 
If I understand correctly, this is about finding out the mimetype of a file, from a shellscript. 
Michael: my suggestion would be a small binary that calls KMimeType::findByURL(). 
Take kdelibs/kio/tests/kmimefromext.cpp as starting point, and remove the ,0,true from 
the findByURL call - and change the binary name ;) 
I'm fine with this binary being installed by kdelibs, it can be useful to other scripts. 
Comment 4 Cristian Tibirna 2005-08-22 21:22:56 UTC
UNCONFIRMED (batch reassigning messed this)
Comment 5 George Goldberg 2007-12-19 04:02:30 UTC
Is this bug still there in a recent version of KDE, such as 3.5.8 or KDE4.0 RC2?
Comment 6 John Layt 2011-05-27 17:41:59 UTC
KDEPrint is obsolete, unmaintained and will never be revived.  Closing all open bugs.