mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-01 05:52:41 +07:00
sensors-conf-convert: Convert voltage formulas correctly
References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=456774
This commit is contained in:
committed by
Michal Suchánek
parent
9e5156cb67
commit
0be39ad911
@@ -34,7 +34,7 @@
|
|||||||
# the user doesn't have a bad surprise when uncommenting them.
|
# the user doesn't have a bad surprise when uncommenting them.
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use vars qw($debug $chip %trans @delete %chip_trans %chip_delete);
|
use vars qw($debug $chip %trans @delete %chip_trans %chip_delete $first_part $second_part $compute_next);
|
||||||
|
|
||||||
BEGIN
|
BEGIN
|
||||||
{
|
{
|
||||||
@@ -480,3 +480,17 @@ elsif (m/^[\s#]*(?:label|ignore|set|compute)\s+(\S+)\s/) {
|
|||||||
$_ = substitute_line($chip, $_);
|
$_ = substitute_line($chip, $_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Formula changes (in0 -> in0_input)
|
||||||
|
if (m/^([\s#]*compute\s+\S+)(.*)/) {
|
||||||
|
$first_part = $1;
|
||||||
|
$second_part = $2;
|
||||||
|
$second_part =~ s/in(\d+)/in$1_input/gi;
|
||||||
|
$_ = "$first_part$second_part\n";
|
||||||
|
$compute_next = 1 if (m/\\$/);
|
||||||
|
} elsif ($compute_next) {
|
||||||
|
s/in(\d+)/in$1_input/gi;
|
||||||
|
$compute_next = 0 if (! m/\\$/);
|
||||||
|
} else {
|
||||||
|
$compute_next = 0;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user