From 5c900c7e851cc1f0de81772432e37a54e9833f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Thu, 17 Oct 2019 15:14:16 +0200 Subject: [PATCH] Replace svn keywords with LM_SENSORS_VER constant The keywords Revision, Date and Id were being expanded by Subversion way back when the project was being maintained in Subversion. Now when the project is maintained in git, the keywords are no longer expanded and appear e.g. in the output of sensors-detect literally. Drop the keywords, or replace them with LM_SENSORS_VER where applicable. The value of the constant will have to be updated manually every time a new release is made. Inspired by a similar change in i2c-tools (commit daa430031ffd; thanks, Jean). --- doc/developers/release_checklist | 1 + prog/detect/sensors-detect | 9 +++------ prog/init/fancontrol.init | 2 -- prog/pwm/pwmconfig | 5 ++--- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/doc/developers/release_checklist b/doc/developers/release_checklist index b84256b5..0744564d 100644 --- a/doc/developers/release_checklist +++ b/doc/developers/release_checklist @@ -11,6 +11,7 @@ Release steps: - Update doc/developers/lm_sensors.lsm (Version, Entered-date and Primary-site) - Update doc/libsensors-API.txt and SENSORS_API_VERSION in lib/sensors.h - Update version.h +- grep for LM_SENSORS_VER and update values of the constant - Commit - Tag the release using git: git tag V3-x-x diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 78b0b5a1..bde31940 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -38,12 +38,9 @@ foreach ('/usr/sbin', '/usr/local/sbin', '/sbin') { ######################### use constant NO_CACHE => 1; +use constant LM_SENSORS_VER => '3.5.0'; use vars qw(@pci_adapters @chip_ids @ipmi_ifs @non_hwmon_chip_ids - $i2c_addresses_to_scan $revision @i2c_byte_cache %opt); - -$revision = '$Revision$ ($Date$)'; -$revision =~ s/\$\w+: (.*?) \$/$1/g; -$revision =~ s/ \([^()]*\)//; + $i2c_addresses_to_scan @i2c_byte_cache %opt); # This is the list of SMBus or I2C adapters we recognize by their PCI # signature. This is an easy and fast way to determine which SMBus or I2C @@ -7511,7 +7508,7 @@ sub main system("/sbin/service", "lm_sensors", "stop"); } - print "# sensors-detect revision $revision\n"; + print "# sensors-detect version ".LM_SENSORS_VER."\n"; initialize_dmi_data(); print_dmi_summary(); print_kernel_version(); diff --git a/prog/init/fancontrol.init b/prog/init/fancontrol.init index eabe734c..8ab2c929 100755 --- a/prog/init/fancontrol.init +++ b/prog/init/fancontrol.init @@ -1,7 +1,5 @@ #!/bin/sh # -# $Id$ -# # fancontrol # # chkconfig: 2345 90 01 diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index a40acd5c..68ac6f79 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -29,8 +29,7 @@ # # -REVISION=$(echo '$Revision$' | cut -d' ' -f2) -REVDATE=$(echo '$Date$' | cut -d' ' -f2) +LM_SENSORS_VER='3.5.0' PIDFILE="/var/run/fancontrol.pid" if [ -f "$PIDFILE" ] @@ -48,7 +47,7 @@ then exit 1 fi -echo "# pwmconfig revision $REVISION ($REVDATE)" +echo "# pwmconfig version $LM_SENSORS_VER" echo 'This program will search your sensors for pulse width modulation (pwm)' echo 'controls, and test each one to see if it controls a fan on' echo 'your motherboard. Note that many motherboards do not have pwm'