-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Simplify versions.sh #4959
Merged
Merged
Simplify versions.sh #4959
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Christian König <ckoenig@posteo.de>
Signed-off-by: Christian König <ckoenig@posteo.de>
Signed-off-by: Christian König <ckoenig@posteo.de>
Signed-off-by: Christian König <ckoenig@posteo.de>
Signed-off-by: Christian König <ckoenig@posteo.de>
Signed-off-by: Christian König <ckoenig@posteo.de>
rdwebdesign
reviewed
Oct 7, 2022
Signed-off-by: Christian König <ckoenig@posteo.de>
eaf2555
to
9471c69
Compare
PromoFaux
reviewed
Oct 9, 2022
PromoFaux
reviewed
Oct 9, 2022
PromoFaux
reviewed
Oct 9, 2022
rdwebdesign
reviewed
Oct 12, 2022
Signed-off-by: Christian König <ckoenig@posteo.de>
Signed-off-by: Christian König <ckoenig@posteo.de>
1e0b477
to
5228347
Compare
PromoFaux
approved these changes
Nov 9, 2022
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/pihole-c-shows-version-errors/59173/13 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR aim to accomplish?:
Simplifies
version.sh
. Rationale: PR #4663 removed the need forsudo
powers ifpihole -v
is called. However, this leads to issues with newergit
versions (seen in #4759) asversion.sh
uses somegit
commands to get the local version and branches. Withoutsudo
,git
complains now aboutfatal: unsafe repository ('/var/www/html/admin' is owned by someone else)
.Since PR #4875 we store local and remote version (and branch) info in
/etc/pihole/versions
. This PR moves the remaining functions fromversion.sh
toupdatechecker.sh
. The latter is always called withsudo
powers and therefore does not run into the describedgit
issue. The remainingversion.sh
does nothing else than to print the requested output of/etc/pihole/versions
.Fixes: #4759
get_remote_version()
toupdatechecker.sh
updatechecker
. That way, we can be sure, that the local branch is updated before we get the remote hash of the the current branch. If you look at the current code, there was only one occurrence wherelocal
andremote
were not called consecutively: the daily cron job. We just agreed to remove the local update from the cron job (Remove cronjob that checks local versions every 10 minutes - only check when required #4939), but this was about updating every 10 minutes. I think updating once every 24h should be fine. We already ensure thatupdatechecker
is called at every relevant place: after a fresh install, after eachpihole -up
and after eachcheckout
.hash
functions toupdatechecker.sh
pihole -v
gather everything from/etc/pihole/versions
By submitting this pull request, I confirm the following:
git rebase
)