libcfg.lib, config-getvar: option '-C|--config': accept a list of configuration files containing wilcards
Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
parent
343e644abe
commit
5008e884d4
@ -18,6 +18,11 @@ Changes in version 1.14.3
|
|||||||
* pck-update - Davide Madrisan:
|
* pck-update - Davide Madrisan:
|
||||||
Fix a string translation by adding the missing '$' prefix.
|
Fix a string translation by adding the missing '$' prefix.
|
||||||
|
|
||||||
|
+ improvement
|
||||||
|
* libcfg.lib, plugins/config-getvar - Davide Madrisan:
|
||||||
|
Option '-C|--config': accept a list of configuration files containing
|
||||||
|
wilcards.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
Changes in version 1.14.2
|
Changes in version 1.14.2
|
||||||
|
@ -106,7 +106,7 @@ function cfg_load_files() {
|
|||||||
if [ "$1" ]; then
|
if [ "$1" ]; then
|
||||||
# select a different list of user configuration files
|
# select a different list of user configuration files
|
||||||
cfgfile_list=(\
|
cfgfile_list=(\
|
||||||
`ls /etc/@package@.conf /etc/@package@.d/*.conf` $1)
|
`ls /etc/@package@.conf /etc/@package@.d/*.conf $1 2>/dev/null`)
|
||||||
else
|
else
|
||||||
# default configuration files
|
# default configuration files
|
||||||
cfgfile_list=(${default_cfg_list[@]})
|
cfgfile_list=(${default_cfg_list[@]})
|
||||||
|
@ -145,9 +145,11 @@ function config.getvar() {
|
|||||||
local cfg_file_lst
|
local cfg_file_lst
|
||||||
|
|
||||||
if [ "$cfg_file" ]; then
|
if [ "$cfg_file" ]; then
|
||||||
[ -r $cfg_file ] ||
|
for f in $(ls $cfg_file 2>/dev/null); do
|
||||||
notify.error $"configuration file not found"" -- \`$cfg_file'"
|
[ -r "$f" ] ||
|
||||||
cfg_file_lst="$cfg_file"
|
notify.error $"configuration file not found"" -- \`$f'"
|
||||||
|
done
|
||||||
|
cfg_file_lst="$(ls $cfg_file 2>/dev/null)"
|
||||||
else
|
else
|
||||||
cfg_file_lst="${default_cfg_list[*]}"
|
cfg_file_lst="${default_cfg_list[*]}"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user