Hello community, here is the log from the commit of package icinga for openSUSE:Factory checked in at 2014-12-29 00:30:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/icinga (Old) and /work/SRC/openSUSE:Factory/.icinga.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "icinga" Changes: -------- --- /work/SRC/openSUSE:Factory/icinga/icinga.changes 2014-12-21 12:04:17.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.icinga.new/icinga.changes 2014-12-29 00:30:24.000000000 +0100 @@ -1,0 +2,7 @@ +Sat Dec 20 17:43:00 UTC 2014 - Led <led...@gmail.com> + +- fix bashism in scripts +- add patches: + * icinga-1.11.7-fix-bashisms.patch + +------------------------------------------------------------------- New: ---- icinga-1.11.7-fix-bashisms.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ icinga.spec ++++++ --- /var/tmp/diff_new_pack.plmLND/_old 2014-12-29 00:30:28.000000000 +0100 +++ /var/tmp/diff_new_pack.plmLND/_new 2014-12-29 00:30:28.000000000 +0100 @@ -54,6 +54,8 @@ Patch0: icinga-workaround-131-apache-conf-issue.patch # PATCH-FIX-OPENSUSE icinga-fix-systemd-services.patch Patch1: icinga-fix-systemd-services.patch +# PATCH-FIX-UPSTREAM icinga-1.11.7-fix-bashisms.patch led...@gmail.com +Patch2: icinga-1.11.7-fix-bashisms.patch Provides: monitoring_daemon BuildRequires: apache2-devel BuildRequires: nagios-rpm-macros >= 0.10 @@ -285,6 +287,7 @@ %patch0 -p1 %endif %patch1 -p1 +%patch2 -p1 %build export PATH_TO_TRACEROUTE="%{_sbindir}/traceroute" ++++++ icinga-1.11.7-fix-bashisms.patch ++++++ diff -Ndur icinga-1.11.7/indent.sh icinga-1.11.7-fix-bashisms/indent.sh --- icinga-1.11.7/indent.sh 2014-09-03 12:27:46.000000000 +0300 +++ icinga-1.11.7-fix-bashisms/indent.sh 2014-12-20 19:39:48.000000000 +0200 @@ -1,3 +1,3 @@ -#!/bin/bash +#!/bin/sh astyle --style=java --indent=tab --unpad-paren --pad-oper --pad-header --suffix=none --brackets=linux "$@" diff -Ndur icinga-1.11.7/maketar.sh icinga-1.11.7-fix-bashisms/maketar.sh --- icinga-1.11.7/maketar.sh 2014-09-03 12:27:46.000000000 +0300 +++ icinga-1.11.7-fix-bashisms/maketar.sh 2014-12-20 19:39:28.000000000 +0200 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh ### # Make a tarball # (c) 2013 NETWAYS GmbH diff -Ndur icinga-1.11.7/module/idoutils/db/scripts/create_mysqldb.sh icinga-1.11.7-fix-bashisms/module/idoutils/db/scripts/create_mysqldb.sh --- icinga-1.11.7/module/idoutils/db/scripts/create_mysqldb.sh 2014-09-03 12:27:46.000000000 +0300 +++ icinga-1.11.7-fix-bashisms/module/idoutils/db/scripts/create_mysqldb.sh 2014-12-20 19:33:04.000000000 +0200 @@ -78,14 +78,14 @@ \q EOS2 umask $UMASK -if [ $? == 0 ]; then +if [ $? = 0 ]; then echo "Check icinga schema version with DB User $DBUSER..." mysql $DB -u $DBUSER -p$DBPASS -h $DBHOST -s <<EOS3 select "DB-Version",version from icinga_dbversion where name='idoutils'; \q EOS3 - if [ $? == 0 ]; then + if [ $? = 0 ]; then echo "Database ready" RET=0 else diff -Ndur icinga-1.11.7/module/idoutils/db/scripts/create_oracledb.sh icinga-1.11.7-fix-bashisms/module/idoutils/db/scripts/create_oracledb.sh --- icinga-1.11.7/module/idoutils/db/scripts/create_oracledb.sh 2014-09-03 12:27:46.000000000 +0300 +++ icinga-1.11.7-fix-bashisms/module/idoutils/db/scripts/create_oracledb.sh 2014-12-20 19:33:48.000000000 +0200 @@ -72,7 +72,7 @@ EOS1 RET=$? -if [ $RET == 0 ]; then +if [ $RET = 0 ]; then #create icinga schema objects using newly created user $SP /nolog <<EOS2 --exit if connect errornous @@ -85,7 +85,7 @@ EOS2 RET=$? #check if dbversion entered(last insert) - if [ $RET == 0 ]; then + if [ $RET = 0 ]; then echo "Connecting now as $DBUSER on $DB and check icinga schema version" $SP /nolog <<EOS3 connect ${DBUSER}/${DBPASS}@${DB} @@ -96,7 +96,7 @@ exit; EOS3 - if [ $? == 0 ]; then + if [ $? = 0 ]; then echo "Database ready" RET=0 else diff -Ndur icinga-1.11.7/selinux/icinga.sh icinga-1.11.7-fix-bashisms/selinux/icinga.sh --- icinga-1.11.7/selinux/icinga.sh 2014-09-03 12:27:46.000000000 +0300 +++ icinga-1.11.7-fix-bashisms/selinux/icinga.sh 2014-12-20 19:37:52.000000000 +0200 @@ -14,12 +14,12 @@ rules=`ausearch --start $time -m avc --raw -se icinga` if [ x"$rules" != "x" ] ; then echo "Found avc's to update policy with" - echo -e "$rules" | audit2allow -R + echo "$rules" | audit2allow -R echo "Do you want these changes added to policy [y/n]?" read ANS if [ "$ANS" = "y" -o "$ANS" = "Y" ] ; then echo "Updating policy" - echo -e "$rules" | audit2allow -R >> icinga.te + echo "$rules" | audit2allow -R >> icinga.te # Fall though and rebuild policy else exit 0 @@ -29,11 +29,11 @@ exit 0 fi else - echo -e $USAGE + echo $USAGE exit 1 fi elif [ $# -ge 2 ] ; then - echo -e $USAGE + echo $USAGE exit 1 fi ++++++ icinga-exec-start-pre ++++++ --- /var/tmp/diff_new_pack.plmLND/_old 2014-12-29 00:30:28.000000000 +0100 +++ /var/tmp/diff_new_pack.plmLND/_new 2014-12-29 00:30:28.000000000 +0100 @@ -7,7 +7,7 @@ # grab a config option -function get_var() { +get_var() { if [ -n "$2" ]; then set -- `grep ^$1 $2 | sed 's@=@ @' | tr -d '[:cntrl:]'` else ++++++ ido2db-exec-start-pre ++++++ --- /var/tmp/diff_new_pack.plmLND/_old 2014-12-29 00:30:28.000000000 +0100 +++ /var/tmp/diff_new_pack.plmLND/_new 2014-12-29 00:30:28.000000000 +0100 @@ -7,7 +7,7 @@ # grab a config option -function get_var() { +get_var() { if [ -n "$2" ]; then set -- `grep ^$1 $2 | sed 's@=@ @' | tr -d '[:cntrl:]'` else ++++++ rcicinga ++++++ --- /var/tmp/diff_new_pack.plmLND/_old 2014-12-29 00:30:28.000000000 +0100 +++ /var/tmp/diff_new_pack.plmLND/_new 2014-12-29 00:30:28.000000000 +0100 @@ -38,7 +38,7 @@ ICINGA_DAEMONCHK='/usr/lib/icinga/cgi/daemonchk.cgi' # Read config and log errors in logfile -function config_check () { +config_check() { case "$1" in verbose) $ICINGA_BIN -v "$ICINGA_CFG" >"$ICINGA_CFG_ERR_LOG" 2>&1 @@ -61,7 +61,7 @@ } # grab a config option -function get_var() { +get_var() { if [ -n "$2" ]; then set -- `grep ^$1 $2 | sed 's@=@ @' | tr -d '[:cntrl:]'` else @@ -72,14 +72,14 @@ } # check some default files and directories -function check_files() { +check_files() { # remove some perhaps left over files for file in "$command_file" "$lock_file" "$status_file" "$temp_file"; do test -f "$file" && rm -f "$file" done } -function check_lock_file() { +check_lock_file() { PIDDIR=$(dirname $lock_file) case "$PIDDIR" in /var/run) @@ -197,7 +197,7 @@ if [ "$check_external_commands" != 0 ]; then while [ ! -e "$command_file" ] && [ $ICINGA_TIMEOUT -gt 0 ]; do sleep 1 - ICINGA_TIMEOUT=$[$ICINGA_TIMEOUT-1] + ICINGA_TIMEOUT=$(($ICINGA_TIMEOUT - 1)) done chgrp $icinga_cmdgrp "$command_file" fi @@ -221,7 +221,7 @@ echo "Warning - Icinga did not exit in a timely manner. Waiting..." while [ -e "$lock_file" ] && [ $ICINGA_TIMEOUT -gt 0 ] ; do sleep 1 - ICINGA_TIMEOUT=$[$ICINGA_TIMEOUT-1] + ICINGA_TIMEOUT=$(($ICINGA_TIMEOUT - 1)) echo -n '.' [ $ICINGA_TIMEOUT -eq 41 ] && echo done ++++++ rcido2db ++++++ --- /var/tmp/diff_new_pack.plmLND/_old 2014-12-29 00:30:28.000000000 +0100 +++ /var/tmp/diff_new_pack.plmLND/_new 2014-12-29 00:30:28.000000000 +0100 @@ -32,7 +32,7 @@ ICINGA_SYSCONFIG="/etc/sysconfig/icinga" # grab a config option -function get_var() { +get_var() { if [ -n "$2" ]; then set -- `grep ^$1 $2 | sed 's@=@ @' | tr -d '[:cntrl:]'` else @@ -43,7 +43,7 @@ } # check some default files and directories -function check_files() { +check_files() { # remove some perhaps left over files for file in "$lock_file" "$socket_name"; do test -e "$file" && rm -f "$file" @@ -121,7 +121,7 @@ echo "Warning - Ido2db did not exit in a timely manner. Waiting..." while [ -e "$lock_file" ] && [ $IDO2DB_TIMEOUT -gt 0 ] ; do sleep 1 - IDO2DB_TIMEOUT=$[$IDO2DB_TIMEOUT-1] + IDO2DB_TIMEOUT=$(($IDO2DB_TIMEOUT - 1)) echo -n '.' [ $IDO2DB_TIMEOUT -eq 41 ] && echo done ++++++ suse.de-icinga ++++++ --- /var/tmp/diff_new_pack.plmLND/_old 2014-12-29 00:30:28.000000000 +0100 +++ /var/tmp/diff_new_pack.plmLND/_new 2014-12-29 00:30:28.000000000 +0100 @@ -1,18 +1,18 @@ -#!/usr/bin/env bash +#!/bin/sh # # Compress old logfiles in /var/log/icinga/archives/ # once a week, if sysconfig variable is set to true # if [ -r /etc/sysconfig/icinga ]; then -. /etc/sysconfig/icinga + . /etc/sysconfig/icinga else echo "/etc/sysconfig/icinga not found or not readable." >&2 exit 1 fi -if [[ "$ICINGA_COMPRESS_LOGFILES" = "true" ]]; then +if [ "$ICINGA_COMPRESS_LOGFILES" = "true" ]; then for f in /var/log/icinga/archives/*.log ; do - if [[ -r "$f" ]] ; then + if [ -r "$f" ] ; then /usr/bin/bzip2 "$f" fi done ++++++ update_icinga_paths.sh ++++++ --- /var/tmp/diff_new_pack.plmLND/_old 2014-12-29 00:30:28.000000000 +0100 +++ /var/tmp/diff_new_pack.plmLND/_new 2014-12-29 00:30:28.000000000 +0100 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh update_config_files () { package="$1" @@ -46,12 +46,12 @@ } # update icinga config files -if [ "$1" == "icinga" ] +if [ "$1" = "icinga" ] then # determine if service was running to be able to restart it after the update [ -f %{icinga_lockfile} ] && service_was_running=true - [ $service_was_running ] && rcicinga stop &>/dev/null || : + [ $service_was_running ] && rcicinga stop >/dev/null 2>&1 ||: ############################################# # update paths to new run directory @@ -89,16 +89,16 @@ ############################################# # start service if it was running before - [ $service_was_running ] && rcicinga start &>/dev/null || : + [ $service_was_running ] && rcicinga start >/dev/null 2>&1 ||: fi # update icinga-idoutils config files -if [ "$1" == "icinga-idoutils" ] +if [ "$1" = "icinga-idoutils" ] then # determine if service was running [ -f %{icinga_ido2db_lockfile} ] && service_was_running=true - [ $service_was_running ] && rcido2db stop &>/dev/null || : + [ $service_was_running ] && rcido2db stop >/dev/null 2>&1 ||: ############################################# # update paths to new run directory @@ -111,5 +111,5 @@ ############################################# # start service if it was running before and there wasn't a major upgrade - [ $service_was_running ] && rcido2db start &>/dev/null || : + [ $service_was_running ] && rcido2db start >/dev/null 2>&1 ||: fi -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org