Changeset 4126

Show
Ignore:
Timestamp:
09/01/06 09:44:54 (7 years ago)
Author:
khali
Message:

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.

Location:
lm-sensors/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r4125 r4126  
    4343                           Add memory size computation for Rambus memory 
    4444                           Various output cleanups and fixes 
     45  Program decode-edid.pl: Add /usr/sbin or /usr/local/sbin to $PATH if needed 
    4546  Program i2cdetect: Add a mode to print adapter functionalities 
    4647  Program i2cdump: Restore bank after bank switching 
  • lm-sensors/trunk/prog/eeprom/decode-edid.pl

    r2277 r4126  
    11#!/usr/bin/perl -w 
    22# 
    3 # Copyright (C) 2003-2004 Jean Delvare <khali@linux-fr.org> 
     3# Copyright (C) 2003-2006 Jean Delvare <khali@linux-fr.org> 
    44# 
    55#    This program is free software; you can redistribute it and/or modify 
     
    2424# Version 1.0  2004-02-08  Jean Delvare <khali@linux-fr.org> 
    2525#  Added support for Linux 2.5/2.6 (i.e. sysfs). 
     26# Version 1.1  2006-09-01  Jean Delvare <khali@linux-fr.org> 
     27#  Append /usr/sbin or /usr/local/sbin to $PATH if needed. 
    2628# 
    2729# EEPROM data decoding for EDID. EDID (Extended Display Identification 
     
    5153use constant PROCFS => 1; 
    5254use constant SYSFS  => 2; 
     55 
     56# parse-edid will typically be installed in /usr/sbin or /usr/local/sbin 
     57# even though regular users can run it 
     58$ENV{PATH} .= ':/usr/local/sbin' 
     59        if $ENV{PATH} !~ m,(^|:)/usr/local/sbin/?(:|$), 
     60        && -x '/usr/local/sbin/parse-edid'; 
     61$ENV{PATH} .= ':/usr/sbin' 
     62        if $ENV{PATH} !~ m,(^|:)/usr/sbin/?(:|$), 
     63        && -x '/usr/sbin/parse-edid'; 
    5364 
    5465sub edid_valid_procfs 
     
    194205{ 
    195206        print STDERR 
    196                 "decode-edid: decode-edid version 1.0\n"; 
     207                "decode-edid: decode-edid version 1.1\n"; 
    197208        if (-r "/proc/sys/dev/sensors/eeprom-i2c-$bus-$address") 
    198209        {