Changeset 4358

Show
Ignore:
Timestamp:
04/04/07 21:24:39 (8 years ago)
Author:
khali
Message:

sensors-detect: Add /usr/sbin to the PATH. i2cdetect might be there instead
of in /usr/local/sbin. Many users have been complaining and several
distribtions were (rightly) modifying sensors-detect because of this.

Location:
lm-sensors/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r4355 r4358  
    1111  Program sensors-detect: Stop Super-I/O probe after first family success 
    1212                          Fix SMSC DME1737 detection 
     13                          Add /usr/sbin to the PATH (#2199) 
    1314 
    1415 
  • lm-sensors/trunk/prog/detect/sensors-detect

    r4355 r4358  
    55#    Copyright (C) 1998 - 2002  Frodo Looijaard <frodol@dds.nl> 
    66#    Copyright (C) 2000 - 2004  The lm_sensors team 
    7 #    Copyright (C) 2005 - 2006  Jean Delvare <khali@linux-fr.org> 
     7#    Copyright (C) 2005 - 2007  Jean Delvare <khali@linux-fr.org> 
    88# 
    99#    This program is free software; you can redistribute it and/or modify 
     
    3535use File::Basename; 
    3636 
    37 # Just in case a root user doesn't have /sbin in his/her path for some reason 
    38 # (was seen once) 
    39 $ENV{PATH} = '/sbin:'.$ENV{PATH} 
    40         unless $ENV{PATH} =~ m,(^|:)/sbin/?(:|$),; 
    41 # Same for /usr/local/sbin since we need i2cdetect which is installed there 
    42 # by default (reported by Lennard Klein) 
    43 $ENV{PATH} = '/usr/local/sbin:'.$ENV{PATH} 
    44         unless $ENV{PATH} =~ m,(^|:)/usr/local/sbin/?(:|$),; 
     37# We will call modprobe and i2cdetect, which typically live in either /sbin, 
     38# /usr/sbin or /usr/local/bin. So make sure these are all in the PATH. 
     39foreach ('/usr/sbin', '/usr/local/sbin', '/sbin') { 
     40        $ENV{PATH} = "$_:".$ENV{PATH} 
     41                unless $ENV{PATH} =~ m/(^|:)$_\/?(:|$)/; 
     42} 
    4543 
    4644#########################