diff options
author | 2023-01-18 21:47:09 +0000 | |
---|---|---|
committer | 2023-01-18 21:49:00 +0000 | |
commit | 6378dbf5695a3344e071a6d14eeb63e172ea21a9 (patch) | |
tree | 5344a057e360268a8990100bbe3898125a547361 /net-proxy/squid | |
parent | dev-db/mysql-connector-c++: add 8.0.32 (diff) | |
download | gentoo-6378dbf5695a3344e071a6d14eeb63e172ea21a9.tar.gz gentoo-6378dbf5695a3344e071a6d14eeb63e172ea21a9.tar.bz2 gentoo-6378dbf5695a3344e071a6d14eeb63e172ea21a9.zip |
net-proxy/squid: adapt symlink/dir replacement collision workaround
Do it in src_install/pkg_preinst/pkg_postinst instead to reduce the window
of fragility (if compile failed before for example, or did "ebuild ... clean configure",
would have a half-migrated state).
Bug: https://bugs.gentoo.org/834503
See: https://github.com/gentoo/gentoo/pull/29138
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-proxy/squid')
-rw-r--r-- | net-proxy/squid/squid-5.7-r1.ebuild (renamed from net-proxy/squid/squid-5.7.ebuild) | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/net-proxy/squid/squid-5.7.ebuild b/net-proxy/squid/squid-5.7-r1.ebuild index 60bc862ec71f..adf1e1062c64 100644 --- a/net-proxy/squid/squid-5.7.ebuild +++ b/net-proxy/squid/squid-5.7-r1.ebuild @@ -85,19 +85,6 @@ pkg_pretend() { fi } -pkg_setup() { - if [[ -n ${REPLACING_VERSIONS} ]]; then - local v - for v in ${REPLACING_VERSIONS}; do - if ver_test "${v}" -lt 5; then - ewarn "Moving ${EROOT}/usr/share/squid/errors out of the way (bug 834503)" - mv -v "${EROOT}"/usr/share/squid/errors{,.bak} - break - fi - done - fi -} - src_prepare() { default @@ -368,13 +355,23 @@ src_install() { diropts -m0750 -o squid -g squid keepdir /var/log/squid /etc/ssl/squid /var/lib/squid + + # Hack for bug #834503 (see also bug #664940) + # Please keep this for a few years until it's no longer plausible + # someone is upgrading from < squid 5.7. + mv "${ED}"/usr/share/squid/errors{,.new} || die } -pkg_postinst() { - if [[ -e ${EROOT}/usr/share/squid/errors.bak ]]; then - rm -rv "${EROOT}"/usr/share/squid/errors.bak - fi +pkg_preinst() { + # Remove file in EROOT that the directory collides with. + rm -rf "${EROOT}"/usr/share/squid/errors || die + # Following the collision protection check, reverse + # src_install's rename in ED. + mv "${ED}"/usr/share/squid/errors{.new,} || die +} + +pkg_postinst() { elog "A good starting point to debug Squid issues is to use 'squidclient mgr:' commands such as 'squidclient mgr:info'." if [[ ${#r} -gt 0 ]]; then |