decode-edid.pl: Append /usr/sbin or /usr/local/sbin to $PATH if needed.

This is needed because parse-edid is typically installed in one of these
directories, even though any user can use it.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4126 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2006-09-01 07:44:54 +00:00
1 parent c857b40f7a
commit 1d97d5c041
2 files changed
+14 -2

No files matched your search

+1
View File
@@ -42,6 +42,7 @@ lm_sensors CHANGES file
timing characteritics for SDRAM/DDR/DDR2 memory
Add memory size computation for Rambus memory
Various output cleanups and fixes
Program decode-edid.pl: Add /usr/sbin or /usr/local/sbin to $PATH if needed
Program i2cdetect: Add a mode to print adapter functionalities
Program i2cdump: Restore bank after bank switching
Add new mode W (read word on even register addresses)
+13 -2
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
#
# Copyright (C) 2003-2004 Jean Delvare <khali@linux-fr.org>
# Copyright (C) 2003-2006 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
@@ -23,6 +23,8 @@
# Fix data block length (128 bytes instead of 256).
# Version 1.0 2004-02-08 Jean Delvare <khali@linux-fr.org>
# Added support for Linux 2.5/2.6 (i.e. sysfs).
# Version 1.1 2006-09-01 Jean Delvare <khali@linux-fr.org>
# Append /usr/sbin or /usr/local/sbin to $PATH if needed.
#
# EEPROM data decoding for EDID. EDID (Extended Display Identification
# Data) is a VESA standard which allows storing (on manufacturer's side)
@@ -51,6 +53,15 @@ use vars qw($bus $address);
use constant PROCFS => 1;
use constant SYSFS => 2;
# parse-edid will typically be installed in /usr/sbin or /usr/local/sbin
# even though regular users can run it
$ENV{PATH} .= ':/usr/local/sbin'
if $ENV{PATH} !~ m,(^|:)/usr/local/sbin/?(:|$),
&& -x '/usr/local/sbin/parse-edid';
$ENV{PATH} .= ':/usr/sbin'
if $ENV{PATH} !~ m,(^|:)/usr/sbin/?(:|$),
&& -x '/usr/sbin/parse-edid';
sub edid_valid_procfs
{
my ($bus, $addr) = @_;
@@ -193,7 +204,7 @@ $bus = bus_detect(8) unless defined $bus;
if(defined $bus)
{
print STDERR
"decode-edid: decode-edid version 1.0\n";
"decode-edid: decode-edid version 1.1\n";
if (-r "/proc/sys/dev/sensors/eeprom-i2c-$bus-$address")
{
edid_decode ($bus, $address, PROCFS);