[PATCH 06/14] email-test-patchset: fix projects list generation

Artem Bityutskiy dedekind1 at gmail.com
Tue Feb 4 09:28:02 PST 2014


From: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>

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 at linux.intel.com>
---
 email/aiaiai-email-test-patchset | 10 ++++++++--
 1 file 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
 }
 
-- 
1.8.5.2




More information about the aiaiai mailing list