diff --git a/data/helpers.d/apt b/data/helpers.d/apt index bcce02dcb..44d5c9c38 100644 --- a/data/helpers.d/apt +++ b/data/helpers.d/apt @@ -51,7 +51,7 @@ ynh_wait_dpkg_free() { ynh_package_is_installed() { # Declare an array to define the options of this helper. local legacy_args=p - declare -Ar args_array=( [p]=package= ) + local -A args_array=( [p]=package= ) local package # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -73,7 +73,7 @@ ynh_package_is_installed() { ynh_package_version() { # Declare an array to define the options of this helper. local legacy_args=p - declare -Ar args_array=( [p]=package= ) + local -A args_array=( [p]=package= ) local package # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -295,7 +295,7 @@ EOF ynh_add_app_dependencies () { # Declare an array to define the options of this helper. local legacy_args=pr - declare -Ar args_array=( [p]=package= [r]=replace) + local -A args_array=( [p]=package= [r]=replace) local package local replace # Manage arguments with getopts @@ -341,7 +341,7 @@ ynh_remove_app_dependencies () { ynh_install_extra_app_dependencies () { # Declare an array to define the options of this helper. local legacy_args=rpkn - declare -Ar args_array=( [r]=repo= [p]=package= [k]=key= [n]=name= ) + local -A args_array=( [r]=repo= [p]=package= [k]=key= [n]=name= ) local repo local package local key @@ -379,7 +379,7 @@ ynh_install_extra_app_dependencies () { ynh_install_extra_repo () { # Declare an array to define the options of this helper. local legacy_args=rkpna - declare -Ar args_array=( [r]=repo= [k]=key= [p]=priority= [n]=name= [a]=append ) + local -A args_array=( [r]=repo= [k]=key= [p]=priority= [n]=name= [a]=append ) local repo local key local priority @@ -448,7 +448,7 @@ ynh_install_extra_repo () { ynh_remove_extra_repo () { # Declare an array to define the options of this helper. local legacy_args=n - declare -Ar args_array=( [n]=name= ) + local -A args_array=( [n]=name= ) local name # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -481,7 +481,7 @@ ynh_remove_extra_repo () { ynh_add_repo () { # Declare an array to define the options of this helper. local legacy_args=uscna - declare -Ar args_array=( [u]=uri= [s]=suite= [c]=component= [n]=name= [a]=append ) + local -A args_array=( [u]=uri= [s]=suite= [c]=component= [n]=name= [a]=append ) local uri local suite local component @@ -521,7 +521,7 @@ ynh_add_repo () { ynh_pin_repo () { # Declare an array to define the options of this helper. local legacy_args=pirna - declare -Ar args_array=( [p]=package= [i]=pin= [r]=priority= [n]=name= [a]=append ) + local -A args_array=( [p]=package= [i]=pin= [r]=priority= [n]=name= [a]=append ) local package local pin local priority diff --git a/data/helpers.d/backup b/data/helpers.d/backup index 590e951a5..9ffb13bbb 100644 --- a/data/helpers.d/backup +++ b/data/helpers.d/backup @@ -46,7 +46,7 @@ ynh_backup() { # Declare an array to define the options of this helper. local legacy_args=sdbm - declare -Ar args_array=( [s]=src_path= [d]=dest_path= [b]=is_big [m]=not_mandatory ) + local -A args_array=( [s]=src_path= [d]=dest_path= [b]=is_big [m]=not_mandatory ) local src_path local dest_path local is_big @@ -220,7 +220,7 @@ with open(sys.argv[1], 'r') as backup_file: ynh_restore_file () { # Declare an array to define the options of this helper. local legacy_args=odm - declare -Ar args_array=( [o]=origin_path= [d]=dest_path= [m]=not_mandatory ) + local -A args_array=( [o]=origin_path= [d]=dest_path= [m]=not_mandatory ) local origin_path local archive_path local dest_path @@ -296,7 +296,7 @@ ynh_bind_or_cp() { ynh_store_file_checksum () { # Declare an array to define the options of this helper. local legacy_args=f - declare -Ar args_array=( [f]=file= ) + local -A args_array=( [f]=file= ) local file # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -328,7 +328,7 @@ ynh_store_file_checksum () { ynh_backup_if_checksum_is_different () { # Declare an array to define the options of this helper. local legacy_args=f - declare -Ar args_array=( [f]=file= ) + local -A args_array=( [f]=file= ) local file # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -361,7 +361,7 @@ ynh_backup_if_checksum_is_different () { ynh_delete_file_checksum () { # Declare an array to define the options of this helper. local legacy_args=f - declare -Ar args_array=( [f]=file= ) + local -A args_array=( [f]=file= ) local file # Manage arguments with getopts ynh_handle_getopts_args "$@" diff --git a/data/helpers.d/fail2ban b/data/helpers.d/fail2ban index 58af9ec0b..5c4cb89a9 100644 --- a/data/helpers.d/fail2ban +++ b/data/helpers.d/fail2ban @@ -65,7 +65,7 @@ ynh_add_fail2ban_config () { # Declare an array to define the options of this helper. local legacy_args=lrmptv - declare -Ar args_array=( [l]=logpath= [r]=failregex= [m]=max_retry= [p]=ports= [t]=use_template [v]=others_var=) + local -A args_array=( [l]=logpath= [r]=failregex= [m]=max_retry= [p]=ports= [t]=use_template [v]=others_var=) local logpath local failregex local max_retry diff --git a/data/helpers.d/getopts b/data/helpers.d/getopts index c8045fa25..285375915 100644 --- a/data/helpers.d/getopts +++ b/data/helpers.d/getopts @@ -6,7 +6,7 @@ # # example: function my_helper() # { -# declare -Ar args_array=( [a]=arg1= [b]=arg2= [c]=arg3 ) +# local -A args_array=( [a]=arg1= [b]=arg2= [c]=arg3 ) # local arg1 # local arg2 # local arg3 @@ -22,13 +22,13 @@ # This helper need an array, named "args_array" with all the arguments used by the helper # that want to use ynh_handle_getopts_args # Be carreful, this array has to be an associative array, as the following example: -# declare -Ar args_array=( [a]=arg1 [b]=arg2= [c]=arg3 ) +# local -A args_array=( [a]=arg1 [b]=arg2= [c]=arg3 ) # Let's explain this array: # a, b and c are short options, -a, -b and -c # arg1, arg2 and arg3 are the long options associated to the previous short ones. --arg1, --arg2 and --arg3 # For each option, a short and long version has to be defined. # Let's see something more significant -# declare -Ar args_array=( [u]=user [f]=finalpath= [d]=database ) +# local -A args_array=( [u]=user [f]=finalpath= [d]=database ) # # NB: Because we're using 'declare' without -g, the array will be declared as a local variable. # diff --git a/data/helpers.d/hardware b/data/helpers.d/hardware index 46e27caf4..1bfc648fe 100644 --- a/data/helpers.d/hardware +++ b/data/helpers.d/hardware @@ -10,7 +10,7 @@ ynh_get_ram () { # Declare an array to define the options of this helper. local legacy_args=ftso - declare -Ar args_array=( [f]=free [t]=total [s]=ignore_swap [o]=only_swap ) + local -A args_array=( [f]=free [t]=total [s]=ignore_swap [o]=only_swap ) local free local total local ignore_swap @@ -75,7 +75,7 @@ ynh_get_ram () { ynh_require_ram () { # Declare an array to define the options of this helper. local legacy_args=rftso - declare -Ar args_array=( [r]=required= [f]=free [t]=total [s]=ignore_swap [o]=only_swap ) + local -A args_array=( [r]=required= [f]=free [t]=total [s]=ignore_swap [o]=only_swap ) local required local free local total diff --git a/data/helpers.d/logging b/data/helpers.d/logging index 89fb89c6e..9f4a89df8 100644 --- a/data/helpers.d/logging +++ b/data/helpers.d/logging @@ -8,7 +8,7 @@ ynh_die() { # Declare an array to define the options of this helper. local legacy_args=mc - declare -Ar args_array=( [m]=message= [c]=ret_code= ) + local -A args_array=( [m]=message= [c]=ret_code= ) local message local ret_code # Manage arguments with getopts @@ -26,7 +26,7 @@ ynh_die() { ynh_print_info() { # Declare an array to define the options of this helper. local legacy_args=m - declare -Ar args_array=( [m]=message= ) + local -A args_array=( [m]=message= ) local message # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -71,7 +71,7 @@ ynh_print_log () { ynh_print_warn () { # Declare an array to define the options of this helper. local legacy_args=m - declare -Ar args_array=( [m]=message= ) + local -A args_array=( [m]=message= ) local message # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -88,7 +88,7 @@ ynh_print_warn () { ynh_print_err () { # Declare an array to define the options of this helper. local legacy_args=m - declare -Ar args_array=( [m]=message= ) + local -A args_array=( [m]=message= ) local message # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -224,7 +224,7 @@ ynh_script_progression () { set +x # Declare an array to define the options of this helper. local legacy_args=mwtl - declare -Ar args_array=( [m]=message= [w]=weight= [t]=time [l]=last ) + local -A args_array=( [m]=message= [w]=weight= [t]=time [l]=last ) local message local weight local time @@ -320,7 +320,7 @@ ynh_debug () { set +x # Declare an array to define the options of this helper. local legacy_args=mt - declare -Ar args_array=( [m]=message= [t]=trace= ) + local -A args_array=( [m]=message= [t]=trace= ) local message local trace # Manage arguments with getopts diff --git a/data/helpers.d/logrotate b/data/helpers.d/logrotate index 9e2429218..f77e25342 100644 --- a/data/helpers.d/logrotate +++ b/data/helpers.d/logrotate @@ -19,7 +19,7 @@ ynh_use_logrotate () { # Declare an array to define the options of this helper. local legacy_args=lnuya - declare -Ar args_array=( [l]=logfile= [n]=nonappend [u]=specific_user= [y]=non [a]=append ) + local -A args_array=( [l]=logfile= [n]=nonappend [u]=specific_user= [y]=non [a]=append ) # [y]=non [a]=append are only for legacy purpose, to not fail on the old option '--non-append' local logfile local nonappend diff --git a/data/helpers.d/mysql b/data/helpers.d/mysql index 91d4abcd2..658a79c17 100644 --- a/data/helpers.d/mysql +++ b/data/helpers.d/mysql @@ -16,7 +16,7 @@ MYSQL_ROOT_PWD_FILE=/etc/yunohost/mysql ynh_mysql_connect_as() { # Declare an array to define the options of this helper. local legacy_args=upd - declare -Ar args_array=( [u]=user= [p]=password= [d]=database= ) + local -A args_array=( [u]=user= [p]=password= [d]=database= ) local user local password local database @@ -37,7 +37,7 @@ ynh_mysql_connect_as() { ynh_mysql_execute_as_root() { # Declare an array to define the options of this helper. local legacy_args=sd - declare -Ar args_array=( [s]=sql= [d]=database= ) + local -A args_array=( [s]=sql= [d]=database= ) local sql local database # Manage arguments with getopts @@ -58,7 +58,7 @@ ynh_mysql_execute_as_root() { ynh_mysql_execute_file_as_root() { # Declare an array to define the options of this helper. local legacy_args=fd - declare -Ar args_array=( [f]=file= [d]=database= ) + local -A args_array=( [f]=file= [d]=database= ) local file local database # Manage arguments with getopts @@ -121,7 +121,7 @@ ynh_mysql_drop_db() { ynh_mysql_dump_db() { # Declare an array to define the options of this helper. local legacy_args=d - declare -Ar args_array=( [d]=database= ) + local -A args_array=( [d]=database= ) local database # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -153,7 +153,7 @@ ynh_mysql_user_exists() { # Declare an array to define the options of this helper. local legacy_args=u - declare -Ar args_array=( [u]=user= ) + local -A args_array=( [u]=user= ) local user # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -192,7 +192,7 @@ ynh_mysql_drop_user() { ynh_mysql_setup_db () { # Declare an array to define the options of this helper. local legacy_args=unp - declare -Ar args_array=( [u]=db_user= [n]=db_name= [p]=db_pwd= ) + local -A args_array=( [u]=db_user= [n]=db_name= [p]=db_pwd= ) local db_user local db_name db_pwd="" @@ -217,7 +217,7 @@ ynh_mysql_setup_db () { ynh_mysql_remove_db () { # Declare an array to define the options of this helper. local legacy_args=un - declare -Ar args_array=( [u]=db_user= [n]=db_name= ) + local -A args_array=( [u]=db_user= [n]=db_name= ) local db_user local db_name # Manage arguments with getopts diff --git a/data/helpers.d/network b/data/helpers.d/network index 330aa5383..0f6e9c442 100644 --- a/data/helpers.d/network +++ b/data/helpers.d/network @@ -11,7 +11,7 @@ ynh_find_port () { # Declare an array to define the options of this helper. local legacy_args=p - declare -Ar args_array=( [p]=port= ) + local -A args_array=( [p]=port= ) local port # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -35,7 +35,7 @@ ynh_find_port () { ynh_port_available () { # Declare an array to define the options of this helper. local legacy_args=p - declare -Ar args_array=( [p]=port= ) + local -A args_array=( [p]=port= ) local port # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -63,7 +63,7 @@ ynh_validate_ip() # Declare an array to define the options of this helper. local legacy_args=fi - declare -Ar args_array=( [f]=family= [i]=ip_address= ) + local -A args_array=( [f]=family= [i]=ip_address= ) local family local ip_address # Manage arguments with getopts @@ -95,7 +95,7 @@ ynh_validate_ip4() { # Declare an array to define the options of this helper. local legacy_args=i - declare -Ar args_array=( [i]=ip_address= ) + local -A args_array=( [i]=ip_address= ) local ip_address # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -116,7 +116,7 @@ ynh_validate_ip6() { # Declare an array to define the options of this helper. local legacy_args=i - declare -Ar args_array=( [i]=ip_address= ) + local -A args_array=( [i]=ip_address= ) local ip_address # Manage arguments with getopts ynh_handle_getopts_args "$@" diff --git a/data/helpers.d/nodejs b/data/helpers.d/nodejs index 288240b1b..03cb5dffb 100644 --- a/data/helpers.d/nodejs +++ b/data/helpers.d/nodejs @@ -68,7 +68,7 @@ ynh_install_nodejs () { # Declare an array to define the options of this helper. local legacy_args=n - declare -Ar args_array=( [n]=nodejs_version= ) + local -A args_array=( [n]=nodejs_version= ) local nodejs_version # Manage arguments with getopts ynh_handle_getopts_args "$@" diff --git a/data/helpers.d/php b/data/helpers.d/php index d5b17c58f..c1ae91c2e 100644 --- a/data/helpers.d/php +++ b/data/helpers.d/php @@ -59,7 +59,7 @@ YNH_PHP_VERSION=${YNH_PHP_VERSION:-$YNH_DEFAULT_PHP_VERSION} ynh_add_fpm_config () { # Declare an array to define the options of this helper. local legacy_args=vtufpd - declare -Ar args_array=( [v]=phpversion= [t]=use_template [u]=usage= [f]=footprint= [p]=package= [d]=dedicated_service ) + local -A args_array=( [v]=phpversion= [t]=use_template [u]=usage= [f]=footprint= [p]=package= [d]=dedicated_service ) local phpversion local use_template local usage @@ -312,7 +312,7 @@ ynh_remove_fpm_config () { ynh_install_php () { # Declare an array to define the options of this helper. local legacy_args=vp - declare -Ar args_array=( [v]=phpversion= [p]=package= ) + local -A args_array=( [v]=phpversion= [p]=package= ) local phpversion local package # Manage arguments with getopts @@ -415,7 +415,7 @@ ynh_remove_php () { ynh_get_scalable_phpfpm () { local legacy_args=ufp # Declare an array to define the options of this helper. - declare -Ar args_array=( [u]=usage= [f]=footprint= [p]=print ) + local -A args_array=( [u]=usage= [f]=footprint= [p]=print ) local usage local footprint local print diff --git a/data/helpers.d/postgresql b/data/helpers.d/postgresql index 03c713afd..ff6ef0f57 100644 --- a/data/helpers.d/postgresql +++ b/data/helpers.d/postgresql @@ -17,7 +17,7 @@ PSQL_ROOT_PWD_FILE=/etc/yunohost/psql ynh_psql_connect_as() { # Declare an array to define the options of this helper. local legacy_args=upd - declare -Ar args_array=([u]=user= [p]=password= [d]=database=) + local -A args_array=([u]=user= [p]=password= [d]=database=) local user local password local database @@ -38,7 +38,7 @@ ynh_psql_connect_as() { ynh_psql_execute_as_root() { # Declare an array to define the options of this helper. local legacy_args=sd - declare -Ar args_array=([s]=sql= [d]=database=) + local -A args_array=([s]=sql= [d]=database=) local sql local database # Manage arguments with getopts @@ -59,7 +59,7 @@ ynh_psql_execute_as_root() { ynh_psql_execute_file_as_root() { # Declare an array to define the options of this helper. local legacy_args=fd - declare -Ar args_array=([f]=file= [d]=database=) + local -A args_array=([f]=file= [d]=database=) local file local database # Manage arguments with getopts @@ -125,7 +125,7 @@ ynh_psql_drop_db() { ynh_psql_dump_db() { # Declare an array to define the options of this helper. local legacy_args=d - declare -Ar args_array=([d]=database=) + local -A args_array=([d]=database=) local database # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -155,7 +155,7 @@ ynh_psql_create_user() { ynh_psql_user_exists() { # Declare an array to define the options of this helper. local legacy_args=u - declare -Ar args_array=([u]=user=) + local -A args_array=([u]=user=) local user # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -174,7 +174,7 @@ ynh_psql_user_exists() { ynh_psql_database_exists() { # Declare an array to define the options of this helper. local legacy_args=d - declare -Ar args_array=([d]=database=) + local -A args_array=([d]=database=) local database # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -210,7 +210,7 @@ ynh_psql_drop_user() { ynh_psql_setup_db() { # Declare an array to define the options of this helper. local legacy_args=unp - declare -Ar args_array=([u]=db_user= [n]=db_name= [p]=db_pwd=) + local -A args_array=([u]=db_user= [n]=db_name= [p]=db_pwd=) local db_user local db_name db_pwd="" @@ -237,7 +237,7 @@ ynh_psql_setup_db() { ynh_psql_remove_db() { # Declare an array to define the options of this helper. local legacy_args=un - declare -Ar args_array=([u]=db_user= [n]=db_name=) + local -A args_array=([u]=db_user= [n]=db_name=) local db_user local db_name # Manage arguments with getopts diff --git a/data/helpers.d/setting b/data/helpers.d/setting index 350ed3ea0..5cc5d19dd 100644 --- a/data/helpers.d/setting +++ b/data/helpers.d/setting @@ -10,7 +10,7 @@ ynh_app_setting_get() { # Declare an array to define the options of this helper. local legacy_args=ak - declare -Ar args_array=( [a]=app= [k]=key= ) + local -A args_array=( [a]=app= [k]=key= ) local app local key # Manage arguments with getopts @@ -30,7 +30,7 @@ ynh_app_setting_get() { ynh_app_setting_set() { # Declare an array to define the options of this helper. local legacy_args=akv - declare -Ar args_array=( [a]=app= [k]=key= [v]=value= ) + local -A args_array=( [a]=app= [k]=key= [v]=value= ) local app local key local value @@ -50,7 +50,7 @@ ynh_app_setting_set() { ynh_app_setting_delete() { # Declare an array to define the options of this helper. local legacy_args=ak - declare -Ar args_array=( [a]=app= [k]=key= ) + local -A args_array=( [a]=app= [k]=key= ) local app local key # Manage arguments with getopts @@ -124,7 +124,7 @@ EOF ynh_webpath_available () { # Declare an array to define the options of this helper. local legacy_args=dp - declare -Ar args_array=( [d]=domain= [p]=path_url= ) + local -A args_array=( [d]=domain= [p]=path_url= ) local domain local path_url # Manage arguments with getopts @@ -146,7 +146,7 @@ ynh_webpath_available () { ynh_webpath_register () { # Declare an array to define the options of this helper. local legacy_args=adp - declare -Ar args_array=( [a]=app= [d]=domain= [p]=path_url= ) + local -A args_array=( [a]=app= [d]=domain= [p]=path_url= ) local app local domain local path_url @@ -180,7 +180,7 @@ ynh_webpath_register () { ynh_permission_create() { # Declare an array to define the options of this helper. local legacy_args=pua - declare -Ar args_array=( [p]=permission= [u]=url= [a]=allowed= ) + local -A args_array=( [p]=permission= [u]=url= [a]=allowed= ) local permission local url local allowed @@ -210,7 +210,7 @@ ynh_permission_create() { ynh_permission_delete() { # Declare an array to define the options of this helper. local legacy_args=p - declare -Ar args_array=( [p]=permission= ) + local -A args_array=( [p]=permission= ) local permission ynh_handle_getopts_args "$@" @@ -226,7 +226,7 @@ ynh_permission_delete() { ynh_permission_exists() { # Declare an array to define the options of this helper. local legacy_args=p - declare -Ar args_array=( [p]=permission= ) + local -A args_array=( [p]=permission= ) local permission ynh_handle_getopts_args "$@" @@ -243,7 +243,7 @@ ynh_permission_exists() { ynh_permission_url() { # Declare an array to define the options of this helper. local legacy_args=pu - declare -Ar args_array=([p]=permission= [u]=url=) + local -A args_array=([p]=permission= [u]=url=) local permission local url ynh_handle_getopts_args "$@" @@ -270,7 +270,7 @@ ynh_permission_url() { ynh_permission_update() { # Declare an array to define the options of this helper. local legacy_args=par - declare -Ar args_array=( [p]=permission= [a]=add= [r]=remove= ) + local -A args_array=( [p]=permission= [a]=add= [r]=remove= ) local permission local add local remove @@ -298,7 +298,7 @@ ynh_permission_update() { ynh_permission_has_user() { local legacy_args=pu # Declare an array to define the options of this helper. - declare -Ar args_array=( [p]=permission= [u]=user= ) + local -A args_array=( [p]=permission= [u]=user= ) local permission local user # Manage arguments with getopts diff --git a/data/helpers.d/string b/data/helpers.d/string index e50f781fe..9b8437953 100644 --- a/data/helpers.d/string +++ b/data/helpers.d/string @@ -11,7 +11,7 @@ ynh_string_random() { # Declare an array to define the options of this helper. local legacy_args=l - declare -Ar args_array=( [l]=length= ) + local -A args_array=( [l]=length= ) local length # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -37,7 +37,7 @@ ynh_string_random() { ynh_replace_string () { # Declare an array to define the options of this helper. local legacy_args=mrf - declare -Ar args_array=( [m]=match_string= [r]=replace_string= [f]=target_file= ) + local -A args_array=( [m]=match_string= [r]=replace_string= [f]=target_file= ) local match_string local replace_string local target_file @@ -66,7 +66,7 @@ ynh_replace_string () { ynh_replace_special_string () { # Declare an array to define the options of this helper. local legacy_args=mrf - declare -Ar args_array=( [m]=match_string= [r]=replace_string= [f]=target_file= ) + local -A args_array=( [m]=match_string= [r]=replace_string= [f]=target_file= ) local match_string local replace_string local target_file @@ -97,7 +97,7 @@ ynh_replace_special_string () { ynh_sanitize_dbid () { # Declare an array to define the options of this helper. local legacy_args=n - declare -Ar args_array=( [n]=db_name= ) + local -A args_array=( [n]=db_name= ) local db_name # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -125,7 +125,7 @@ ynh_sanitize_dbid () { ynh_normalize_url_path () { # Declare an array to define the options of this helper. local legacy_args=p - declare -Ar args_array=( [p]=path_url= ) + local -A args_array=( [p]=path_url= ) local path_url # Manage arguments with getopts ynh_handle_getopts_args "$@" diff --git a/data/helpers.d/systemd b/data/helpers.d/systemd index 47e905f0f..276674e70 100644 --- a/data/helpers.d/systemd +++ b/data/helpers.d/systemd @@ -18,7 +18,7 @@ ynh_add_systemd_config () { # Declare an array to define the options of this helper. local legacy_args=st - declare -Ar args_array=( [s]=service= [t]=template= ) + local -A args_array=( [s]=service= [t]=template= ) local service local template # Manage arguments with getopts @@ -54,7 +54,7 @@ ynh_add_systemd_config () { ynh_remove_systemd_config () { # Declare an array to define the options of this helper. local legacy_args=s - declare -Ar args_array=( [s]=service= ) + local -A args_array=( [s]=service= ) local service # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -81,7 +81,7 @@ ynh_remove_systemd_config () { ynh_systemd_action() { # Declare an array to define the options of this helper. local legacy_args=nalpte - declare -Ar args_array=( [n]=service_name= [a]=action= [l]=line_match= [p]=log_path= [t]=timeout= [e]=length= ) + local -A args_array=( [n]=service_name= [a]=action= [l]=line_match= [p]=log_path= [t]=timeout= [e]=length= ) local service_name local action local line_match diff --git a/data/helpers.d/user b/data/helpers.d/user index 7051ed4c0..72cb9bece 100644 --- a/data/helpers.d/user +++ b/data/helpers.d/user @@ -11,7 +11,7 @@ ynh_user_exists() { # Declare an array to define the options of this helper. local legacy_args=u - declare -Ar args_array=( [u]=username= ) + local -A args_array=( [u]=username= ) local username # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -32,7 +32,7 @@ ynh_user_exists() { ynh_user_get_info() { # Declare an array to define the options of this helper. local legacy_args=uk - declare -Ar args_array=( [u]=username= [k]=key= ) + local -A args_array=( [u]=username= [k]=key= ) local username local key # Manage arguments with getopts @@ -63,7 +63,7 @@ ynh_user_list() { ynh_system_user_exists() { # Declare an array to define the options of this helper. local legacy_args=u - declare -Ar args_array=( [u]=username= ) + local -A args_array=( [u]=username= ) local username # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -78,7 +78,7 @@ ynh_system_user_exists() { ynh_system_group_exists() { # Declare an array to define the options of this helper. local legacy_args=g - declare -Ar args_array=( [g]=group= ) + local -A args_array=( [g]=group= ) local group # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -103,7 +103,7 @@ ynh_system_group_exists() { ynh_system_user_create () { # Declare an array to define the options of this helper. local legacy_args=uhs - declare -Ar args_array=( [u]=username= [h]=home_dir= [s]=use_shell ) + local -A args_array=( [u]=username= [h]=home_dir= [s]=use_shell ) local username local home_dir local use_shell @@ -137,7 +137,7 @@ ynh_system_user_create () { ynh_system_user_delete () { # Declare an array to define the options of this helper. local legacy_args=u - declare -Ar args_array=( [u]=username= ) + local -A args_array=( [u]=username= ) local username # Manage arguments with getopts ynh_handle_getopts_args "$@" diff --git a/data/helpers.d/utils b/data/helpers.d/utils index 133a47247..5f352ab96 100644 --- a/data/helpers.d/utils +++ b/data/helpers.d/utils @@ -99,7 +99,7 @@ ynh_abort_if_errors () { ynh_setup_source () { # Declare an array to define the options of this helper. local legacy_args=ds - declare -Ar args_array=( [d]=dest_dir= [s]=source_id= ) + local -A args_array=( [d]=dest_dir= [s]=source_id= ) local dest_dir local source_id # Manage arguments with getopts @@ -304,7 +304,7 @@ properly with chmod/chown." ynh_secure_remove () { # Declare an array to define the options of this helper. local legacy_args=f - declare -Ar args_array=( [f]=file= ) + local -A args_array=( [f]=file= ) local file # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -378,7 +378,7 @@ ynh_get_plain_key() { ynh_read_manifest () { # Declare an array to define the options of this helper. local legacy_args=mk - declare -Ar args_array=( [m]=manifest= [k]=manifest_key= ) + local -A args_array=( [m]=manifest= [k]=manifest_key= ) local manifest local manifest_key # Manage arguments with getopts @@ -406,7 +406,7 @@ ynh_read_manifest () { ynh_app_upstream_version () { # Declare an array to define the options of this helper. local legacy_args=m - declare -Ar args_array=( [m]=manifest= ) + local -A args_array=( [m]=manifest= ) local manifest # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -430,7 +430,7 @@ ynh_app_upstream_version () { ynh_app_package_version () { # Declare an array to define the options of this helper. local legacy_args=m - declare -Ar args_array=( [m]=manifest= ) + local -A args_array=( [m]=manifest= ) local manifest # Manage arguments with getopts ynh_handle_getopts_args "$@"