-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Only update the package cache on fresh installations #6282
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
Conversation
Signed-off-by: Christian König <[email protected]>
…tallation Signed-off-by: Christian König <[email protected]>
The seconds commit should fix the tests. Not sure why we had |
I think we should still update the package cache when the meta package is updated, so all new dependencies are up to date. |
This would be possible too. We would only need to signal |
How does this compare to #6274 ? |
In the current implementation or the one suggestion by @darkexplosiveqwx ? #6274 removes also the building and installing of the dependency package before doing an update - which might fails because some 'installer dependency' is not installed. |
Ah, okay. Maybe something like |
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 was changed in https://github.com/pi-hole/pi-hole/pull/6034/files#diff-d47c0707deb6f9f41a6a35ba455245c05e2297b4d408551721dda75b1c1be394L92
@PromoFaux Do you know why the lines were changed here
I'm a little hesitant to remove the lines completely when we don't know why they were there in the first place.
So I just changed them in the tests, too. |
It was added in the first place with this commit Back then, the test added configuration to setupVars.conf to automatically install the web interace and the web server. This is no longer needed. pi-hole/test/test_automated_install.py Lines 198 to 214 in cedd1a2
|
I'm not sure if this is the way to go. While it addresses the suggestions from above, it adds 100 lines of code. I'm not sure if this is worth it, considering 'normal' users will only benefit from it during an update which is not happening that often. I would go another way as a middle ground: only update the cache before we install the meta package initiated by the install script, but not from the updater. ADD |
Signed-off-by: Christian König <[email protected]>
…voking from the install script Signed-off-by: Christian König <[email protected]>
The last two changes allow to update the cache when building/installing the meta package from the installer script, but don't do when building/installing from the update script. |
But it saves about 160 lines with each If there is an update to core repo with NO meta packages changes or just an FTL update it would save double the lines and double the SD activity. Currently all package management steps are done twice is these two scenarios, once at the beginning of and would also ensure that
does not happen as well. |
I'd like to go for this PR for now as it improves the situation. The massive change in #6298 needs some very thorough review and testing and that's going to take time. Considering this is a QOL fix and not a bug fix, I'm good with what Yubi has written. |
Where do you see these 160 lines? This is the output that I see with this branch code:
I think I like the idea of always creating/updating the dependency package. It gives us a guarantee that the update will function because it will add the packages that we know we need to run the update. This accounts for the case where a user removes a package that we need from the system, and it's really a light process to run. I don't see it generating a lot of writes to any drive or storage media. Here's a verbose run of the update code: + build_dependency_package
+ rm -rf '/tmp/pihole-meta_*'
+ local tempdir
++ mktemp --directory /tmp/pihole-meta_XXXXX
+ tempdir=/tmp/pihole-meta_JaZox
+ chmod 0755 /tmp/pihole-meta_JaZox
+ is_command apt-get
+ local check_command=apt-get
+ command -v apt-get
+ pushd /tmp
+ rm -f /tmp/pihole-meta.deb
+ mkdir -p /tmp/pihole-meta_JaZox/DEBIAN
+ chmod 0755 /tmp/pihole-meta_JaZox/DEBIAN
+ touch /tmp/pihole-meta_JaZox/DEBIAN/control
+ echo 'Package: pihole-meta
Version: 0.4
Maintainer: Pi-hole team <[email protected]>
Architecture: all
Description: Pi-hole dependency meta package
Depends: awk,bash-completion,binutils,ca-certificates,cron|cron-daemon,curl,dialog,dnsutils,dns-root-data,git,grep,iproute2,iputils-ping,jq,libcap2,libcap2-bin,lshw,netcat-openbsd,procps,psmisc,sudo,unzip
Section: contrib/metapackages
Priority: optional'
+ local 'str=Building dependency package pihole-meta.deb'
+ printf ' %b %s...' '[i]' 'Building dependency package pihole-meta.deb'
[i] Building dependency package pihole-meta.deb...+ dpkg-deb --build --root-owner-group /tmp/pihole-meta_JaZox pihole-meta.deb
+ printf '%b %b %s\n' '\r' '[✓]' 'Building dependency package pihole-meta.deb'
[✓] Building dependency package pihole-meta.deb
+ popd
+ rm -rf /tmp/pihole-meta_JaZox
+ install_dependent_packages
+ local 'str=Installing Pi-hole dependency package'
+ printf ' %b %s...' '[i]' 'Installing Pi-hole dependency package'
[i] Installing Pi-hole dependency package...+ is_command apt-get
+ local check_command=apt-get
+ command -v apt-get
+ '[' -f /tmp/pihole-meta.deb ']'
+ eval 'apt-get -qq --no-install-recommends install' /tmp/pihole-meta.deb
+ printf '%b %b %s\n' '\r' '[✓]' 'Installing Pi-hole dependency package'
[✓] Installing Pi-hole dependency package
+ rm /tmp/pihole-meta.deb
+ printf '\n' |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/pi-hole-core-v6-1-3-released/81168/1 |
What does this PR aim to accomplish?:
Only update the package cache once on fresh installs, not on checkouts/updates. Addresses #6272
By submitting this pull request, I confirm the following:
git rebase
)