summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2014-02-04 17:17:49 +0200
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2014-02-04 19:33:07 +0200
commit33d523505385228f0f32a8298b305210b9759a41 (patch)
tree67341de12199425d738d67b5f538ca05477cd6b2
parente15b3b8441dcc437269c56accf70c4bcb901325d (diff)
downloadaiaiai-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-xemail/aiaiai-email-test-patchset10
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
}