winecheck patch for finding libwine.so
ghutchis at cisco.com
ghutchis at cisco.com
Wed Oct 31 17:39:16 CST 2001
On my system, doing a "find / -name libwine.so" never completes
(possibly due to NFS mounted filesystems, but whatever). It also may
over-count, since libraries it finds may not be in the search path.
I patched winecheck to examine /etc/ld.so.conf and LD_LIBRARY_PATH
and look for wine libraries in those locations.
Pros: much faster, only searches lib directories that system uses
Cons: won't find library at all on mis-configured system, vulnerable
to variations in location/name of ld.so.conf
YMMV.
- Guy
*** winecheck Wed Oct 31 15:25:24 2001
--- winecheck.old Wed Oct 31 15:11:18 2001
***************
*** 217,247 ****
$level = $is_ok;
my @output = ();
Do_Check("for correct .so lib config (please wait)");
!
! # Build list of library directories.
! # First parse ld.so.conf to find system-wide lib directories.
! my @dirlist = ();
! open (LDCONF, "</etc/ld.so.conf");
! while (<LDCONF>) {
! s/\#.*//; # eliminate comments
! chomp;
! if (-d $_) { push @dirlist, $_; }
! }
! close (LDCONF);
! # Next parse LD_LIBRARY_PATH to find user-specific lib dirs.
! my (@ld_dirs) = split (/:/, $ENV{'LD_LIBRARY_PATH'});
! my ($dir);
! foreach $dir (@ld_dirs) {
! if (-d $dir) { push @dirlist, $dir; }
! }
!
! # Now check for a libwine.so in each directory
! foreach $dir (@dirlist) {
! my ($target) = $dir . "/libwine.so";
! if (-f $target) { push @output, $target; }
! }
! print "DEBUG: found libwine: @output\n";
!
if (@output > 1)
{
$level = $is_suspect;
--- 217,223 ----
$level = $is_ok;
my @output = ();
Do_Check("for correct .so lib config (please wait)");
! push (@output, `find / -name libwine.so 2>/dev/null`);
if (@output > 1)
{
$level = $is_suspect;
More information about the wine-patches
mailing list