Menu

#7 libdvdread detection

v1.0_(example)
open
nobody
None
5
2006-10-09
2006-10-09
No

In the dvrequant script, the "type" shell command is
used to find libdvdread, which will never work. This is
caught by slocate which should work, so most people
will remain blissfully unaware of the problem.
However, the following fixes the problem:

# Try to find libdvdread.so.3, looking first in the
most obvious places
if [[ $( test -f /usr/lib/libdvdread.so.3 ) ]]; then
HAVE_READ="y"
elif [[ $( test -f /usr/local/lib/libdvdread.so.3 ) ]];
then HAVE_READ="y"
elif [[ $( slocate libdvdread.so.3 | head -n 1 ) ]];
then HAVE_READ="y"
fi

where test -f is used instead of type -p.

Discussion

  • Dominic Amann

    Dominic Amann - 2006-10-09

    Logged In: YES
    user_id=667288

    Also true of test for libdvdcss

     
  • Dominic Amann

    Dominic Amann - 2006-10-10

    Logged In: YES
    user_id=667288

    Also, if you fix the code as suggested, this is the only
    dependency on slocate, which I for one object to having on
    my system merely to look for two libraries every time I
    backup a dvd.

     
  • Dominic Amann

    Dominic Amann - 2006-10-10

    Logged In: YES
    user_id=667288

    if test -f /usr/lib/libdvdread.so.3 ; then
    HAVE_READ="y"
    elif test -f /usr/local/lib/libdvdread.so.3 );
    then HAVE_READ="y"
    fi

     
  • galaxy66

    galaxy66 - 2007-12-02

    Logged In: YES
    user_id=1659871
    Originator: NO

    What about?: /usr/lib64/... /usr/local/lib64/...

    And why slocate? Many distros have locate and find but not slocate.

    Nice script but I had to hack so it wouldn't complain on my Mandriva
    x86_64 system.

     

Log in to post a comment.