diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2014-02-04 17:17:49 +0200 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2014-02-04 19:33:07 +0200 |
commit | 33d523505385228f0f32a8298b305210b9759a41 (patch) | |
tree | 67341de12199425d738d67b5f538ca05477cd6b2 | |
parent | e15b3b8441dcc437269c56accf70c4bcb901325d (diff) | |
download | aiaiai-33d523505385228f0f32a8298b305210b9759a41.tar.gz |
email-test-patchset: fix projects list generation
This patch fixes the 'list_projects()' which did not work because it was using
the 'cfg_descr' variable which was undefined. Indeed, this function is called
when the user either forgot to specify the project, or specified a non-existing
project.
This patch uses 'ini_config_get_or_die' to get project description. The whole
loop conctruct is cleaned up a bit too to make it more readable.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rwxr-xr-x | email/aiaiai-email-test-patchset | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/email/aiaiai-email-test-patchset b/email/aiaiai-email-test-patchset index 305bd51..12224d4 100755 --- a/email/aiaiai-email-test-patchset +++ b/email/aiaiai-email-test-patchset @@ -75,8 +75,14 @@ list_projects() { local prj - LC_ALL=C sed -n -e "s/^\[prj_\(.*\)\]$/\1/p" "$cfgfile" | while read -r prj; do - printf "* %s\n" "$cfg_ownmail_local+$prj@$cfg_ownmail_domain: $cfg_descr" + LC_ALL=C sed -n -e "s/^\[prj_\(.*\)\]$/\1/p" "$cfgfile" | \ + while read -r prj; do + # Get project description + local descr + ini_config_get_or_die descr "$cfgfile" "prj_$prj" "description" + + local email="$cfg_ownmail_local+$prj@$cfg_ownmail_domain" + printf "* %s\n" "$prj ($email): $descr" done } |