Skip to content

Commit

Permalink
Improved auto-cpufreq version detection for aur package
Browse files Browse the repository at this point in the history
  • Loading branch information
AdnanHodzic committed Feb 6, 2021
1 parent 9fcc99d commit 82b41f4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions auto_cpufreq/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,19 @@ def file_stats():
# display running version of auto-cpufreq
def app_version():

aur_pkg_check = call("pacman -Qs auto-cpufreq > /dev/null", shell=True)

print("auto-cpufreq version:")

# snap package
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
if aur_pkg_check == 1:
print("Git commit:", check_output(["git", "describe", "--always"]).strip().decode())
else:
print(getoutput("pacman -Qi auto-cpufreq* | grep Version"))
else:
# source code (auto-cpufreq-installer)
try:
Expand Down

0 comments on commit 82b41f4

Please sign in to comment.