]> git.ipfire.org Git - people/ms/network.git/commitdiff
Drop deprecated listmatch function
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 15 Jul 2017 00:55:52 +0000 (20:55 -0400)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 15 Jul 2017 00:55:52 +0000 (20:55 -0400)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.bridge
src/functions/functions.cli
src/functions/functions.device
src/functions/functions.firewall
src/functions/functions.ip
src/functions/functions.list
src/functions/functions.ports
src/functions/functions.settings
src/functions/functions.stp
src/functions/functions.util

index 46ca80c2b63f66357dd617c417001408bd5a4431..0ce7ad2a0a2e5d45e8bbf69d0679a5ac41acf1da 100644 (file)
@@ -104,7 +104,7 @@ bridge_attach_device() {
        fi
 
        # If device is already attached, exit silently.
-       if listmatch ${device} $(bridge_get_members ${bridge}); then
+       if list_match ${device} $(bridge_get_members ${bridge}); then
                return ${EXIT_OK}
        fi
 
@@ -145,7 +145,7 @@ bridge_detach_device() {
        fi
 
        # If device is not attched, exit silently.
-       if ! listmatch ${device} $(bridge_get_members ${bridge}); then
+       if ! list_match ${device} $(bridge_get_members ${bridge}); then
                return ${EXIT_OK}
        fi
 
index 1bd99dd127dc56c7fa1f656f6357cbac2682d10e..b3696e6d513d862cee5719eb61f869558a557c8c 100644 (file)
@@ -25,7 +25,7 @@ cli_help_requested() {
        local argument="${1}"
 
        if [ -n "${argument}" ]; then
-               if listmatch ${argument} help -h --help; then
+               if list_match ${argument} help -h --help; then
                        return ${EXIT_TRUE}
                fi
        fi
@@ -391,11 +391,11 @@ cli_yesno() {
                read yesno
 
                # Check for "yes".
-               if listmatch ${yesno} y Y yes YES Yes; then
+               if list_match ${yesno} y Y yes YES Yes; then
                        return ${EXIT_TRUE}
 
                # Check for "no".
-               elif listmatch ${yesno} n N no NO No; then
+               elif list_match ${yesno} n N no NO No; then
                        return ${EXIT_FALSE}
                fi
        done
index 09848e27f8f5bb54b40e73fd3600bdccf2395023..b33c8cd18505de4d452dd251903410af99c98e70 100644 (file)
@@ -775,7 +775,7 @@ device_has_ip() {
                        ;;
        esac
 
-       listmatch ${addr} $(device_get_addresses ${device})
+       list_match ${addr} $(device_get_addresses ${device})
 }
 
 device_get_addresses() {
index c484c2ac1159430220a8c4d0fa705f5f063c09e5..a503c62081535c489e677672a37af3f1ae015302 100644 (file)
@@ -735,7 +735,7 @@ _firewall_parse_rule_line() {
        while read -r arg; do
                key=$(cli_get_key ${arg})
 
-               if ! listmatch "${key}" ${FIREWALL_RULES_CONFIG_PARAMS}; then
+               if ! list_match "${key}" ${FIREWALL_RULES_CONFIG_PARAMS}; then
                        log WARNING "Unrecognized argument: ${arg}"
                        return ${EXIT_ERROR}
                fi
index 5a82114119d774dfc40f8838d52becd1b1d3d249..d6fd76dc3ae78e58f761c880431dba0e20accdb6 100644 (file)
@@ -62,7 +62,7 @@ ip_protocol_is_supported() {
 
        assert isset proto
 
-       listmatch ${proto} ${IP_SUPPORTED_PROTOCOLS}
+       list_match ${proto} ${IP_SUPPORTED_PROTOCOLS}
 }
 
 ip_is_valid() {
index 7069168513e05c22b79f62e6a903a18b788d1091..26ba6c34e4185c25488b90a619f472048de32605 100644 (file)
@@ -56,7 +56,7 @@ list_remove() {
 
        local _list k
        for k in ${!list}; do
-               listmatch ${k} $@ && continue
+               list_match ${k} $@ && continue
 
                _list="${_list} ${k}"
        done
index 1c911f1151efd81a5d1a4d08898d960cf88a17b3..d2e8fd09b957ecbd48987b6bef927436c44eed28 100644 (file)
@@ -143,7 +143,7 @@ port_is_attached() {
                assert isset zone
                assert zone_exists ${zone}
 
-               if listmatch ${port} $(zone_get_ports ${zone}); then
+               if list_match ${port} $(zone_get_ports ${zone}); then
                        echo "${zone}"
                        return ${EXIT_OK}
                fi
@@ -190,12 +190,12 @@ port_destroy() {
        for other_port in $(ports_get); do
                [ "${other_port}" = "${port}" ] && continue
 
-               if listmatch ${port} $(port_get_parents ${other_port}); then
+               if list_match ${port} $(port_get_parents ${other_port}); then
                        error_log "Cannot destroy port '${port}' which is a parent port to '${other_port}'."
                        ok=${EXIT_ERROR}
                fi
 
-               if listmatch ${port} $(port_get_children ${other_port}); then
+               if list_match ${port} $(port_get_children ${other_port}); then
                        error_log "Cannot destroy port '${port}' which is child of port '${other_port}'."
                        ok=${EXIT_ERROR}
                fi
index 630f90aa91741c811af3ef7769c5d3cd512b4ced..f714e2295ca450baf8aa3f805511097b50078bcf 100644 (file)
@@ -55,7 +55,7 @@ settings_read() {
 
                                # If valid keys is set, key must be in the list.
                                if [ -n "${valid_keys}" ]; then
-                                       if ! listmatch ${key} ${valid_keys}; then
+                                       if ! list_match ${key} ${valid_keys}; then
                                                if ! enabled ignore_superfluous_settings; then
                                                        log DEBUG "Ignoring configuration setting: ${key}"
                                                fi
@@ -99,7 +99,7 @@ settings_read_array() {
 
                                # If valid_keys is set, key must be in the list.
                                if [ -n "${valid_keys}" ]; then
-                                       if ! listmatch ${key} ${valid_keys}; then
+                                       if ! list_match ${key} ${valid_keys}; then
                                                log DEBUG "Ignoring configuration setting: ${key}"
                                                continue
                                        fi
index 0e6ae3923f6fe1b7b7eb38008d62591ed71922b9..e9e08c4335a6b23a25c30ac14370ef2544a7beb2 100644 (file)
@@ -100,7 +100,7 @@ stp_bridge_set_protocol() {
        local mode=${2}
        assert isset mode
 
-       if ! listmatch ${mode} ${STP_ALLOWED_MODES}; then
+       if ! list_match ${mode} ${STP_ALLOWED_MODES}; then
                log WARNING "Unknown protocol version: ${mode}."
                log WARNING "Using default mode."
 
index 99af3b4e934d6d3217476db23084280307ea94cc..13c78757ee4105d0eccfc7c1d3616cfd504ec4e0 100644 (file)
@@ -82,12 +82,7 @@ warning_log() {
        log WARNING "$@"
 }
 
-# The next two functions are kept for backwards
-# compatibility. The need to be dropped at some time.
-listmatch() {
-       list_match $@
-}
-
+# Deprecated
 listlength() {
        list_length $@
 }