-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add mechanism to auto update most of packages #7977
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some final changes
After this, I will experiment with these to make sure they don't cause troubles on master
Leave this on me, I will do this after merging
Glad you are looking into it :) |
neovim-nightly
|
Anything holding this up? We're down to only 73% of our packages being up to date, we used to be in the 90s a year or two ago. |
No hurry, but I think we should definitely expand beyond only auto-updating github-housed projects. |
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
- hook to be called when auto updating. - it may be overridden by build.sh Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
- compare current and latest version retrived from respective api Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
Please ignore ci failures. They are due to not upto date |
Ping @Grimler91 |
@MrAdityaAlok commits and structure looks reasonable, thanks. Please update the nightly hashsum so that we can see if the build succeeds, and so that debs can be inspected if needed |
# Make script sourceable as well as executable. | ||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then | ||
declare -f termux_error_exit >/dev/null || . "$(dirname "${BASH_SOURCE[0]}")/termux_error_exit.sh" | ||
termux_pkg_is_update_needed "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a script scripts/bin/apt-compare-versions which aims at doing pretty much the same thing as this script, with the difference that it prints the result in a human-friendly way. Please remove the other one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I remove this whole function or only the code making it executable?
I have removed the code making it executable (though not pushed still) but did you ment also to use scripts/bin/apt-compare-versions
in this function...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a more rigorous implementation than the other one, so I suggest to use this one and remove scripts/bin/apt-compare-versions. Possible improvement to this termux_pkg_is_update_needed.sh script would be to add a "human-readable" mode, which prints the versions as the other script did, but since that isn't related to auto updates or neovim it's not something that has to be added as part of this PR IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still I would add that functionality in this PR only. I have exams in upcoming days, so would be busy there for few weeks...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's fine. Fix the email address and I can merge it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added that functionality. Please review again.
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
…e_needed` Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
This commit has been automatically submitted by Github Actions.
This commit has been automatically submitted by Github Actions.
This commit has been automatically submitted by Github Actions.
Allows for auto-updates of more packages, not only the ones that are released through github. Ref: #7977
|
GITHUB_API_TOKEN
. No need now since wirkflow only run for already present packages, not also for PR.Functions:
Main function (overridable)
This should be overrided for using custom update method. For example look here.
termux_pkg_auto_update
: determine which update script to use for auto-updatingUtility/API (available publicly)
termux_pkg_upgrade_version
: to write new version to build.shtermux_pkg_is_update_nedded
: determine wheteher package needs to be updatedtermux_pkg_get_last_updated
: get last updated date for github housed packages. It is used for api cache call to lower api call rate.termux_github_api_get_tag
: returns latest/newest version tagtermux_gitlab_api_get_tag
: returns latest/newest version tagtermux_repology_api_get_latest_version
: returns latest versionInternal functions (should not be overrided)
termux_github_auto_update
: default update algorithm for packages hosted on github.comtermux_gitlab_auto_update
: default update algorithm for pkgs hosted on gitlab.comtermux_repology_auto_update
: default update algorithm for pkgs hosted on repology.orgTests
./update_packages <package name>
(GITHUB_TOKEN
should be set in env.)