Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added optional path in --update #538

Merged
merged 8 commits into from
Sep 18, 2023
Merged

Conversation

cosmos1721
Copy link
Contributor

@cosmos1721 cosmos1721 commented Jul 23, 2023

in continuation of PR #535
as per your suggestions, an optional add to path has been added.
i.e. auto-cpufreq --update=path/to/dir

i was expecting to use:
auto-cpufreq --update path/to/dir
but there are some unknown issues

@AdnanHodzic
Copy link
Owner

  1. Let's set to use /opt/auto-cpufreq/source as the default path as part of --update as part of this PR, and then having ability to set "custom path" can be made as part of one of following iterations.

Besides this I'll leave couple of comments for the code itself, as I found some bugs.

  1. What's the proper mechanism for testing --update changes? As changing i.e VERSION = "1.9.8" line in setup.py had no impact, and even changing auto-cpufreq-installer file to trick it into that there are updates:
    # Fetch the latest release information from GitHub API
    #latest_release=$(curl -s "https://api.github.com/repos/$repository/releases/latest")
    # Extract the latest release version without using jq
    #latest_version=$(echo "$latest_release" | grep -o '"tag_name": "[^"]*' | cut -d'"' -f4)
    latest_version=v1.9.9 # same case with v2.0
    # Get the current version of auto-cpufreq
      #installed_version=$(pip list | awk '/auto-cpufreq/ {print $2}')
    installed_version=$(grep -oP "(?<=__requires__ = 'auto-cpufreq==)\d+(\.\d+)+" /opt/auto-cpufreq/venv/bin/auto-cpufreq)

kept returning:

sudo auto-cpufreq --update 
auto-cpufreq is up to date

auto-cpufreq-installer Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
bin/auto-cpufreq Outdated Show resolved Hide resolved
bin/auto-cpufreq Outdated Show resolved Hide resolved
bin/auto-cpufreq Outdated Show resolved Hide resolved
bin/auto-cpufreq Outdated
if os.path.exists(custom_dir):
os.rmdir(custom_dir)
os.makedirs(custom_dir)
else:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need line 262 & 263, as this directory would've been created above if it doesn't exist.

@AdnanHodzic
Copy link
Owner

LGTM, thank you for your contribution!

@AdnanHodzic AdnanHodzic merged commit 7e02a07 into AdnanHodzic:master Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants