Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: Calling tlp-stat end with two error messages due to syntax error in the script. Version-Release number of selected component (if applicable): tlp-0.9-2.fc25.noarch How reproducible: Always Steps to Reproduce: 1. call tlp-stat Actual results: The output ends with: /bin/tlp-stat: line 1217: [: -ne: unary operator expected /bin/tlp-stat: line 1221: [: -ne: unary operator expected Expected results: No syntax error message. Additional info: Looking at the code, I guess that it's due to: cat: /sys/class/power_supply/BAT1/energy_full_design: No such device cat: /sys/class/power_supply/BAT1/energy_full: No such device meaning that $ed and $ef are not set, which the code doesn't expect.
I would say this is due to both /sys/class/power_supply/BAT1/energy_full and /sys/class/power_supply/BAT1/charge_full being missing on your system. Can you confirm this?
Actually, the files were there but they were not related to any device (if I remove the battery, the message becomes "No such file or directory"). It was probably due to the battery being completely empty: after a load the files and their devices were there again. Your analysis is kind of correct, but the script should be improved to catch cleanly such use case.
Understood, I've contacted upstream and I will be back-porting a fix. Thanks for your feedback!
tlp-0.9-4.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-3467d39a3e
tlp-0.9-4.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-63643860fe
tlp-0.9-4.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-3467d39a3e
tlp-0.9-4.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-63643860fe
tlp-0.9-4.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
tlp-0.9-4.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.