diff options
author | Michael Orlitzky <mjo@gentoo.org> | 2016-01-22 12:47:43 -0500 |
---|---|---|
committer | Michael Orlitzky <mjo@gentoo.org> | 2016-01-22 12:47:43 -0500 |
commit | 2b82d0c0c967f59f5993bea53bb5dd86693beef0 (patch) | |
tree | 0892e16968436739bcb3a3dc7d61fd8163735d1b | |
parent | Add a TODO to find_targets() about an error condition. (diff) | |
download | eselect-php-2b82d0c0c967f59f5993bea53bb5dd86693beef0.tar.gz eselect-php-2b82d0c0c967f59f5993bea53bb5dd86693beef0.tar.bz2 eselect-php-2b82d0c0c967f59f5993bea53bb5dd86693beef0.zip |
Remove cleanup_sapis() and ensmarten the libphp[57].so symlink removal.
The cleanup_sapis() function was only called in one place, so it was a
pointless layer of indirection. Move it into do_cleanup(). Also, make
sure we don't remove libphp[57].so symlinks unless they're actually
symlinks and in fact dead.
-rw-r--r-- | src/php.eselect.in.in | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/php.eselect.in.in b/src/php.eselect.in.in index ff3914f..7e52f53 100644 --- a/src/php.eselect.in.in +++ b/src/php.eselect.in.in @@ -173,14 +173,6 @@ parse_target_major_version() { esac } -cleanup_sapis() { - local m - local link - for m in $MODULES ; do - cleanup_sapi $m - done -} - cleanup_sapi() { local sapi="${1}" local l="${sapi}_link" @@ -197,11 +189,6 @@ cleanup_sapi() { fi fi - if [[ "${sapi}" == "apache2" ]] ; then - rm -f "@LIBDIR@"/apache2/modules/libphp[57].so \ - || die "failed to remove old libphp.so symlink" - fi - return 1 } @@ -582,5 +569,18 @@ describe_cleanup_options() { } do_cleanup() { - cleanup_sapis + for sapi in $MODULES ; do + cleanup_sapi "${sapi}" + done + + # Remove older (and dead) apache2 symlinks. These days the symlink + # is called mod_php.so. This cleanup code can be removed after a + # while, after we think most people will have switched to the new + # symlink and removed the old one. + for link in "@LIBDIR@"/apache2/modules/libphp[57].so; do + if [[ -L "${link}" && ! -e "${link}" ]] ; then + rm -f "${link}" || die "failed to remove old libphp.so symlink" + echo "Removed broken symlink ${link}." + fi + done } |