Accepting request 257575 from home:Ledest:misc

fix bashisms in nss-mdns-config

OBS-URL: https://build.opensuse.org/request/show/257575
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/nss-mdns?expand=0&rev=12
This commit is contained in:
Dominique Leuenberger 2014-10-20 18:59:13 +00:00 committed by Git OBS Bridge
parent b3c51497b4
commit b408562f1b
3 changed files with 22 additions and 17 deletions

View File

@ -37,7 +37,7 @@
NSSWITCH=/etc/nsswitch.conf NSSWITCH=/etc/nsswitch.conf
function usage() { usage() {
echo "nss-mdns-config [--enable|--disable] [-4|-6] [--no-backup]" echo "nss-mdns-config [--enable|--disable] [-4|-6] [--no-backup]"
} }
@ -101,11 +101,11 @@ if test "$ENABLE" -ne 1 -a "$DISABLE" -ne 1; then
ENABLED=0 ENABLED=0
for ITEM in $VALUE; do for ITEM in $VALUE; do
if test "$ITEM" == "mdns4_minimal" -o "$ITEM" == "mdns4"; then if [ "$ITEM" = "mdns4_minimal" -o "$ITEM" = "mdns4" ]; then
IPv4_ENABLED=1 IPv4_ENABLED=1
elif test "$ITEM" == "mdns6_minimal" -o "$ITEM" == "mdns6"; then elif [ "$ITEM" = "mdns6_minimal" -o "$ITEM" = "mdns6" ]; then
IPv6_ENABLED=1 IPv6_ENABLED=1
elif test "$ITEM" == "mdns_minimal" -o "$ITEM" == "mdns"; then elif [ "$ITEM" = "mdns_minimal" -o "$ITEM" = "mdns" ]; then
ENABLED=1 ENABLED=1
fi fi
done done
@ -128,11 +128,11 @@ elif test "$DISABLE" -eq 1; then
DROPACTION=0 DROPACTION=0
for ITEM in $VALUE; do for ITEM in $VALUE; do
if test \( "$ITEM" == "mdns4_minimal" -o "$ITEM" == "mdns4" \) -a "$IPv4" -eq 1; then if [ "$ITEM" = "mdns4_minimal" -o "$ITEM" = "mdns4" ] && [ "$IPv4" -eq 1 ]; then
DROPACTION=1 DROPACTION=1
elif test \( "$ITEM" == "mdns6_minimal" -o "$ITEM" == "mdns6" \) -a "$IPv6" -eq 1; then elif [ "$ITEM" = "mdns6_minimal" -o "$ITEM" = "mdns6" ] && [ "$IPv6" -eq 1 ]; then
DROPACTION=1 DROPACTION=1
elif test "$ITEM" == "mdns_minimal" -o "$ITEM" == "mdns"; then elif [ "$ITEM" = "mdns_minimal" -o "$ITEM" = "mdns" ]; then
if test "$IPvALL" -eq 1; then if test "$IPvALL" -eq 1; then
DROPACTION=1 DROPACTION=1
elif test "$IPv4" -eq 1; then elif test "$IPv4" -eq 1; then
@ -145,7 +145,7 @@ elif test "$DISABLE" -eq 1; then
echo "Internal error when disabling $ITEM." echo "Internal error when disabling $ITEM."
exit 1 exit 1
fi fi
elif test "${ITEM::1}" == "[" -a "$DROPACTION" -eq 1; then elif [ "${ITEM#[}" != "$ITEM" -a "$DROPACTION" -eq 1 ]; then
DROPACTION=0 DROPACTION=0
else else
NEWVALUE="$NEWVALUE $ITEM" NEWVALUE="$NEWVALUE $ITEM"
@ -168,20 +168,20 @@ elif test "$ENABLE" -eq 1; then
DROPACTION=0 DROPACTION=0
for ITEM in $VALUE; do for ITEM in $VALUE; do
if test \( "$ITEM" == "mdns_minimal" -o "$ITEM" == "mdns4_minimal" -o "$ITEM" == "mdns6_minimal" \); then if [ "$ITEM" = "mdns_minimal" -o "$ITEM" = "mdns4_minimal" -o "$ITEM" = "mdns6_minimal" ]; then
if test "$FOUND_DNS" -eq 1; then if test "$FOUND_DNS" -eq 1; then
# don't keep *_minimal after dns; it's not desired there # don't keep *_minimal after dns; it's not desired there
DROPACTION=1 DROPACTION=1
else else
if test "$IPvALL" -eq 1 -a \( "$ITEM" == "mdns4_minimal" -o "$ITEM" == "mdns6_minimal" \); then if [ "$IPvALL" -eq 1 ] && [ "$ITEM" = "mdns4_minimal" -o "$ITEM" = "mdns6_minimal" ]; then
# no need to keep mdns[46]_minimal since we'll add mdns_minimal # no need to keep mdns[46]_minimal since we'll add mdns_minimal
DROPACTION=1 DROPACTION=1
else else
if test "$ITEM" == "mdns_minimal"; then if [ "$ITEM" = "mdns_minimal" ]; then
FOUND=1 FOUND=1
elif test "$ITEM" == "mdns4_minimal" -a "$IPv4" -eq 1; then elif [ "$ITEM" = "mdns4_minimal" -a "$IPv4" -eq 1 ]; then
FOUND=1 FOUND=1
elif test "$ITEM" == "mdns6_minimal" -a "$IPv6" -eq 1; then elif [ "$ITEM" = "mdns6_minimal" -a "$IPv6" -eq 1 ]; then
FOUND=1 FOUND=1
fi fi
# force the use of [NOTFOUND=return] after *_minimal # force the use of [NOTFOUND=return] after *_minimal
@ -189,10 +189,10 @@ elif test "$ENABLE" -eq 1; then
DROPACTION=1 DROPACTION=1
fi fi
fi fi
elif test \( "$ITEM" == "mdns" -o "$ITEM" == "mdns4" -o "$ITEM" == "mdns6" \); then elif [ "$ITEM" = "mdns" -o "$ITEM" = "mdns4" -o "$ITEM" = "mdns6" ]; then
# we simply don't use the non-minimal version in our setup, so drop it # we simply don't use the non-minimal version in our setup, so drop it
DROPACTION=1 DROPACTION=1
elif test "$ITEM" == "dns"; then elif [ "$ITEM" = "dns" ]; then
FOUND_DNS=1 FOUND_DNS=1
DROPACTION=0 DROPACTION=0
if test "$FOUND" -ne 1; then if test "$FOUND" -ne 1; then
@ -210,7 +210,7 @@ elif test "$ENABLE" -eq 1; then
else else
NEWVALUE="$NEWVALUE $ITEM" NEWVALUE="$NEWVALUE $ITEM"
fi fi
elif test "${ITEM::1}" == "[" -a "$DROPACTION" -eq 1; then elif [ "${ITEM#[}" != "$ITEM" -a "$DROPACTION" -eq 1 ]; then
DROPACTION=0 DROPACTION=0
else else
NEWVALUE="$NEWVALUE $ITEM" NEWVALUE="$NEWVALUE $ITEM"

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Sat Oct 18 20:14:00 UTC 2014 - Led <ledest@gmail.com>
- fix bashisms in nss-mdns-config
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Apr 15 13:34:44 UTC 2013 - idonmez@suse.com Mon Apr 15 13:34:44 UTC 2013 - idonmez@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package nss-mdns # spec file for package nss-mdns
# #
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed