From da025c6349ba299d29cd79c0fcd4c907bc5be355 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 16 Apr 2012 12:35:51 +0000 Subject: Michael Proko: 30414: more flexible configuration file finding for _mdadm --- ChangeLog | 5 ++++- Completion/Linux/Command/_mdadm | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 23fd23f31..522aa2960 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2012-04-16 Peter Stephenson + * Michael Prokop: 30414: Completion/Linux/Command/_mdadm: more + flexible configuration file usage. + * 30413: Src/params.c, Src/utils.c, Test/D04parameter.ztst: (q-) parameter flag should quote the empty string and should report an error with extra trailing q's. @@ -16208,5 +16211,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5632 $ +* $Revision: 1.5633 $ ***************************************************** diff --git a/Completion/Linux/Command/_mdadm b/Completion/Linux/Command/_mdadm index 461e66617..940eb6887 100644 --- a/Completion/Linux/Command/_mdadm +++ b/Completion/Linux/Command/_mdadm @@ -147,7 +147,15 @@ fi _mds () { local -a vals - vals=( ${${${(M)${(f)"$(< /etc/mdadm.conf)"}##ARRAY *}//ARRAY /}%%[[:blank:]]*} ) + if [ -r /etc/mdadm.conf ] ; then + local mdadm_conf=/etc/mdadm.conf + elif [ -r /etc/mdadm/mdadm.conf ] ; then + local mdadm_conf=/etc/mdadm/mdadm.conf + else + _message "could not find mdadm.conf" + return 1 + fi + vals=( ${${${(M)${(f)"$(< $mdadm_conf)"}##ARRAY *}//ARRAY /}%%[[:blank:]]*} ) _describe -t mds "RAID devices" vals _arguments \ "(-h --help)"{-h,--help}'[display a mode specific help message]' -- cgit 1.4.1