From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 7C6CB58973 for ; Fri, 22 Jan 2016 20:53:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 58DBC21C007; Fri, 22 Jan 2016 20:53:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BEF8221C007 for ; Fri, 22 Jan 2016 20:53:37 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ECA55340AE0 for ; Fri, 22 Jan 2016 20:53:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 60C05CB3 for ; Fri, 22 Jan 2016 20:53:34 +0000 (UTC) From: "Michael Orlitzky" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michael Orlitzky" Message-ID: <1453495868.0c235fbacfaf5e741ea6d613eb531541e7e66368.mjo@gentoo> Subject: [gentoo-commits] proj/eselect-php:master commit in: src/ X-VCS-Repository: proj/eselect-php X-VCS-Files: src/php.eselect.in.in X-VCS-Directories: src/ X-VCS-Committer: mjo X-VCS-Committer-Name: Michael Orlitzky X-VCS-Revision: 0c235fbacfaf5e741ea6d613eb531541e7e66368 X-VCS-Branch: master Date: Fri, 22 Jan 2016 20:53:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 73045404-02f0-4c34-8d8a-9ef08378c62e X-Archives-Hash: fe109ee87d49dc2ad7195ab63a478ce0 commit: 0c235fbacfaf5e741ea6d613eb531541e7e66368 Author: Michael Orlitzky gentoo org> AuthorDate: Fri Jan 22 20:51:08 2016 +0000 Commit: Michael Orlitzky gentoo org> CommitDate: Fri Jan 22 20:51:08 2016 +0000 URL: https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=0c235fba Move the apache conf file writing into set_sapi(). When the apache conf file was being written in do_set(), it was avoidable by e.g. update_sapi(). That could prevent apache2 from restarting. Since do_set() calls set_sapi() anyway, we just move the conf file writing to the end of set_sapi(). src/php.eselect.in.in | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/php.eselect.in.in b/src/php.eselect.in.in index 603dced..8e25f96 100644 --- a/src/php.eselect.in.in +++ b/src/php.eselect.in.in @@ -461,6 +461,17 @@ set_sapi() { "${link_dir}/${link_name}" || \ die -q "failed to create active ${link_name} symlink" done + + # The call to write_mod_php_conf() in particular needs to take + # place here, in set_sapi(), since otherwise it can get skipped by + # e.g. the update_sapi() function. + if [[ "${sapi}" == "apache2" ]]; then + apache2_php5_config_check + write_mod_php_conf "${target_name}" + echo "Please restart apache for the changes to take effect." + elif [[ "${sapi}" == "fpm" ]]; then + echo "Please restart php-fpm for the changes to take effect." + fi } @@ -508,14 +519,6 @@ do_set() { check_module "${sapi}" set_sapi "${sapi}" "${target}" - - if [[ "${sapi}" == "apache2" ]]; then - apache2_php5_config_check - write_mod_php_conf "$(resolv_target apache2 "${target}")" - echo "Please restart apache for the changes to take effect." - elif [[ "${sapi}" == "fpm" ]]; then - echo "Please restart php-fpm for the changes to take effect." - fi }