mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-31 14:25:39 +00:00
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. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4375 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
# sensors-detect - Detect PCI bus and chips
|
||||
# Copyright (C) 1998 - 2002 Frodo Looijaard <frodol@dds.nl>
|
||||
# Copyright (C) 2000 - 2004 The lm_sensors team
|
||||
# Copyright (C) 2005 - 2006 Jean Delvare <khali@linux-fr.org>
|
||||
# Copyright (C) 2005 - 2007 Jean Delvare <khali@linux-fr.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -34,14 +34,12 @@ use Fcntl;
|
||||
use POSIX;
|
||||
use File::Basename;
|
||||
|
||||
# Just in case a root user doesn't have /sbin in his/her path for some reason
|
||||
# (was seen once)
|
||||
$ENV{PATH} = '/sbin:'.$ENV{PATH}
|
||||
unless $ENV{PATH} =~ m,(^|:)/sbin/?(:|$),;
|
||||
# Same for /usr/local/sbin since we need i2cdetect which is installed there
|
||||
# by default (reported by Lennard Klein)
|
||||
$ENV{PATH} = '/usr/local/sbin:'.$ENV{PATH}
|
||||
unless $ENV{PATH} =~ m,(^|:)/usr/local/sbin/?(:|$),;
|
||||
# We will call modprobe and i2cdetect, which typically live in either /sbin,
|
||||
# /usr/sbin or /usr/local/bin. So make sure these are all in the PATH.
|
||||
foreach ('/usr/sbin', '/usr/local/sbin', '/sbin') {
|
||||
$ENV{PATH} = "$_:".$ENV{PATH}
|
||||
unless $ENV{PATH} =~ m/(^|:)$_\/?(:|$)/;
|
||||
}
|
||||
|
||||
#########################
|
||||
# CONSTANT DECLARATIONS #
|
||||
|
Reference in New Issue
Block a user