From: Michael Tremer Date: Sat, 15 Jul 2017 00:55:52 +0000 (-0400) Subject: Drop deprecated listmatch function X-Git-Tag: 009~174 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c9205b101dd1a49f1152ec487f3444c467887ed;p=people%2Fms%2Fnetwork.git Drop deprecated listmatch function Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.bridge b/src/functions/functions.bridge index 46ca80c2..0ce7ad2a 100644 --- a/src/functions/functions.bridge +++ b/src/functions/functions.bridge @@ -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 diff --git a/src/functions/functions.cli b/src/functions/functions.cli index 1bd99dd1..b3696e6d 100644 --- a/src/functions/functions.cli +++ b/src/functions/functions.cli @@ -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 diff --git a/src/functions/functions.device b/src/functions/functions.device index 09848e27..b33c8cd1 100644 --- a/src/functions/functions.device +++ b/src/functions/functions.device @@ -775,7 +775,7 @@ device_has_ip() { ;; esac - listmatch ${addr} $(device_get_addresses ${device}) + list_match ${addr} $(device_get_addresses ${device}) } device_get_addresses() { diff --git a/src/functions/functions.firewall b/src/functions/functions.firewall index c484c2ac..a503c620 100644 --- a/src/functions/functions.firewall +++ b/src/functions/functions.firewall @@ -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 diff --git a/src/functions/functions.ip b/src/functions/functions.ip index 5a821141..d6fd76dc 100644 --- a/src/functions/functions.ip +++ b/src/functions/functions.ip @@ -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() { diff --git a/src/functions/functions.list b/src/functions/functions.list index 70691685..26ba6c34 100644 --- a/src/functions/functions.list +++ b/src/functions/functions.list @@ -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 diff --git a/src/functions/functions.ports b/src/functions/functions.ports index 1c911f11..d2e8fd09 100644 --- a/src/functions/functions.ports +++ b/src/functions/functions.ports @@ -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 diff --git a/src/functions/functions.settings b/src/functions/functions.settings index 630f90aa..f714e229 100644 --- a/src/functions/functions.settings +++ b/src/functions/functions.settings @@ -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 diff --git a/src/functions/functions.stp b/src/functions/functions.stp index 0e6ae392..e9e08c43 100644 --- a/src/functions/functions.stp +++ b/src/functions/functions.stp @@ -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." diff --git a/src/functions/functions.util b/src/functions/functions.util index 99af3b4e..13c78757 100644 --- a/src/functions/functions.util +++ b/src/functions/functions.util @@ -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 $@ }