Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 635400 - www-servers/apache: QA Notice: shell script appears to use non-POSIX feature(s)
Summary: www-servers/apache: QA Notice: shell script appears to use non-POSIX feature(s)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-25 08:56 UTC by Tomáš Mózes
Modified: 2018-05-29 08:35 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomáš Mózes 2017-10-25 08:56:28 UTC
* QA Notice: shell script appears to use non-POSIX feature(s):
 *    possible bashism in /etc/init.d/apache2 line 154 (type):
 *      if ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
 *    possible bashism in /etc/init.d/apache2 line 171 (type):
 *      if ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
Comment 1 Tomáš Mózes 2017-10-25 12:25:41 UTC
--- /etc/init.d/apache2.virgin  2017-10-25 14:24:51.440581907 +0200
+++ /etc/init.d/apache2 2017-10-25 12:03:37.205711587 +0200
@@ -151,7 +151,7 @@
 }
 
 fullstatus() {
-       if ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
+       if ! command -v $(set -- ${LYNX}; echo $1) 2>/dev/null; then
                eerror "lynx not found! you need to emerge www-client/lynx"
        else
                ${LYNX} ${STATUSURL}
@@ -168,7 +168,7 @@
 
        checkconfd || return 1
 
-       if ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
+       if ! command -v $(set -- ${LYNX}; echo $1) 2>/dev/null; then
                eerror "lynx not found! you need to emerge www-client/lynx"
        else
                echo "${APACHE2} started with '${APACHE2_OPTS}'"
Comment 2 Tomáš Mózes 2017-10-25 12:28:14 UTC
Hm... This prints the lynx command, must somehow mute it.
Comment 3 Tomáš Mózes 2017-10-25 12:34:25 UTC
This seems to work nicer, tested with bash and dash:

--- /etc/init.d/apache2.virgin  2017-10-25 14:24:51.440581907 +0200
+++ /etc/init.d/apache2 2017-10-25 14:32:10.350036438 +0200
@@ -151,7 +151,7 @@
 }
 
 fullstatus() {
-       if ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
+       if ! command -v $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
                eerror "lynx not found! you need to emerge www-client/lynx"
        else
                ${LYNX} ${STATUSURL}
@@ -168,7 +168,7 @@
 
        checkconfd || return 1
 
-       if ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
+       if ! command -v $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
                eerror "lynx not found! you need to emerge www-client/lynx"
        else
                echo "${APACHE2} started with '${APACHE2_OPTS}'"
Comment 4 Tomáš Mózes 2018-04-13 07:39:21 UTC
A friendly bump :)
Comment 5 Larry the Git Cow gentoo-dev 2018-04-19 20:50:57 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/apache.git/commit/?id=65a60b84f492efeb391e853724c12c0b78b2aa25

commit 65a60b84f492efeb391e853724c12c0b78b2aa25
Author:     Tomáš Mózes <hydrapolic@gmail.com>
AuthorDate: 2018-04-19 20:49:27 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2018-04-19 20:49:27 +0000

    init scripts: Replaced non-POSIX compliant "type -p" calls.
    
    Closes: https://bugs.gentoo.org/635400

 2.2/init/apache2.initd | 4 ++--
 2.4/init/apache2.initd | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
Comment 6 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2018-04-19 20:51:33 UTC
(In reply to Tomáš Mózes from comment #4)
> A friendly bump :)

Sorry for the inadequately long delay. I will fix this with the next apache bump.
Comment 7 Tomáš Mózes 2018-04-20 06:39:42 UTC
No problem, thank you very much :)
Comment 8 Larry the Git Cow gentoo-dev 2018-05-29 08:35:45 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a898b593a3ab8ebeecdf872089ca1bb158668f0

commit 2a898b593a3ab8ebeecdf872089ca1bb158668f0
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2018-05-29 08:34:52 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2018-05-29 08:35:38 +0000

    www-servers/apache: Revbump to fix bashisms in init script.
    
    Also added mod_md module.
    
    Closes: https://bugs.gentoo.org/651570
    Closes: https://bugs.gentoo.org/635400
    Package-Manager: Portage-2.3.40, Repoman-2.3.9

 www-servers/apache/Manifest                                |  2 +-
 .../{apache-2.4.33.ebuild => apache-2.4.33-r1.ebuild}      | 14 +++++++++-----
 www-servers/apache/metadata.xml                            |  1 +
 3 files changed, 11 insertions(+), 6 deletions(-)