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

Do not update package cache on install/upgrade #5502

Closed
wants to merge 1 commit into from

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Nov 26, 2023

What does this implement/fix?

Do not update package cache on install/upgrade. It takes quite a long time and we don't do this for dnf/yum either.


Related issue or feature (if applicable): N/A

Pull request in docs with documentation (if applicable): N/A


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

  • The code change is tested and works locally.
  • I based my code and PRs against the repositories developmental branch.
  • I signed off all commits. Pi-hole enforces the DCO for all contributions
  • I signed all my commits. Pi-hole requires signatures to verify authorship
  • I have read the above and my PR is ready for review.

@DL6ER DL6ER requested a review from a team November 26, 2023 08:37
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pihole-up-skip-package-update/66512/15

Copy link
Member

@yubiuser yubiuser left a comment

Choose a reason for hiding this comment

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

Do we wan to keep notify_package_updates_available()?

@DL6ER
Copy link
Member Author

DL6ER commented Nov 26, 2023

No, I think this is only due to the artificially clean environment of a CI container. No real OS will know nothing about their sources. We neither support installing into naked container (or do we?).

If we do, the logic needs to be changed to use apt-cache to check if we have install candidates for packages and, if not, then indeed run apt update.

Converting this PR to draft and doing this later...

@DL6ER DL6ER marked this pull request as draft November 26, 2023 16:29
@DL6ER DL6ER marked this pull request as ready for review November 27, 2023 13:10
@DL6ER DL6ER requested a review from a team November 27, 2023 13:16
Copy link
Member

@yubiuser yubiuser left a comment

Choose a reason for hiding this comment

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

This is not a good place to put the update function. It will update the cache 3 times in a row on new installs as install_dependent_packages() is called 3 times during installation and usually not empty.

@DL6ER
Copy link
Member Author

DL6ER commented May 12, 2024

@yubiuser I simplified the approach

@PromoFaux
Copy link
Member

I'm a little confused as to the logic here...

PKG_MANAGER_UPDATE is defaulted to false. once update_package_cache runs, it is set to true and so subsequent calls of this function will not do the package update.

What I can't see here is how we get ourselves into a situation where update_package_cache is run more than once... Sure, it would run each time one runs pihole -up... but each time that is run the value of PKG_MANAGER_UPDATE will be false... and therefore the update_package_cache function will run in full.

Maybe I'm just being dense... but what is the goal here?

@DL6ER
Copy link
Member Author

DL6ER commented May 12, 2024

I think this PR has been changed too often and it was abandoned too often, too, to reproduce its original intention. Closing.

@DL6ER DL6ER closed this May 12, 2024
@DL6ER DL6ER deleted the tweak/no_apt_update branch May 12, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants