mirror of
https://github.com/AdnanHodzic/auto-cpufreq.git
synced 2025-07-23 21:55:09 +02:00
Output auto-cpufreq version for snap/aur/auto-cpufreq-installer
This commit is contained in:
parent
d062ca940f
commit
6bffee4535
@ -55,13 +55,28 @@ def file_stats():
|
|||||||
auto_cpufreq_stats_file = open(auto_cpufreq_stats_path, "w")
|
auto_cpufreq_stats_file = open(auto_cpufreq_stats_path, "w")
|
||||||
sys.stdout = auto_cpufreq_stats_file
|
sys.stdout = auto_cpufreq_stats_file
|
||||||
|
|
||||||
# ToDo: read version from snap/snapcraft.yaml and write to $SNAP/version for use with snap installs
|
# get distro name
|
||||||
# also come up with same kind of solution for AUR
|
dist_name = distro.id()
|
||||||
|
|
||||||
|
# display running version of auto-cpufreq
|
||||||
def app_version():
|
def app_version():
|
||||||
try:
|
|
||||||
print("Build git commit:", check_output(["git", "describe", "--always"]).strip().decode())
|
print("auto-cpufreq version:")
|
||||||
except:
|
# snap package
|
||||||
pass
|
if os.getenv('PKG_MARKER') == "SNAP":
|
||||||
|
print(getoutput("echo Snap: $SNAP_VERSION"))
|
||||||
|
# aur package
|
||||||
|
elif dist_name in ["arch", "manjaro", "garuda"]:
|
||||||
|
try:
|
||||||
|
print("pacman -Qi auto-cpufreq* | grep Version")
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
# source code (auto-cpufreq-installer)
|
||||||
|
try:
|
||||||
|
print("Git commit:", check_output(["git", "describe", "--always"]).strip().decode())
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def app_res_use():
|
def app_res_use():
|
||||||
p = psutil.Process()
|
p = psutil.Process()
|
||||||
@ -671,7 +686,7 @@ def python_info():
|
|||||||
run("echo \"distro package\" $(pip3 show distro | sed -n -e 's/^.*Version: //p')", shell=True)
|
run("echo \"distro package\" $(pip3 show distro | sed -n -e 's/^.*Version: //p')", shell=True)
|
||||||
|
|
||||||
def device_info():
|
def device_info():
|
||||||
print("Computer type", getoutput('dmidecode --string chassis-type'))
|
print("Computer type:", getoutput('dmidecode --string chassis-type'))
|
||||||
|
|
||||||
|
|
||||||
def distro_info():
|
def distro_info():
|
||||||
|
@ -87,11 +87,7 @@ def main(monitor, live, install, stats, log, daemon, debug):
|
|||||||
distro_info()
|
distro_info()
|
||||||
sysinfo()
|
sysinfo()
|
||||||
print("")
|
print("")
|
||||||
if os.getenv('PKG_MARKER') == "SNAP":
|
app_version()
|
||||||
print("Snap package: yes")
|
|
||||||
else:
|
|
||||||
app_version()
|
|
||||||
print("Snap package: no")
|
|
||||||
print("")
|
print("")
|
||||||
python_info()
|
python_info()
|
||||||
print("")
|
print("")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user