]> www.infradead.org Git - users/dedekind/aiaiai.git/commitdiff
email-sh-functions: rename project configuration variables
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 5 Feb 2014 12:30:25 +0000 (14:30 +0200)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 5 Feb 2014 15:12:12 +0000 (17:12 +0200)
This is another cosmetic change which is supposed to improve the readability.
Let's distinguish between global and project parameters by using slightly
differnet variabls prefix: "cfg_" for global parameters and "pcfg_" for
per-project. Then in the contexts where we do not yet know the project, we'd
not use any of the "pcfg_" variables, and possibly avoid introducing bugs.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
email/aiaiai-email-lda
email/aiaiai-email-sh-functions
email/aiaiai-email-test-patchset

index 02a4a6b184213191f9f11952efdfa66e55df8e87..2f75c3ede3c066abdf4dff8541523d7df7abcde8 100755 (executable)
@@ -103,7 +103,7 @@ reject_and_reply()
        verbose "Project \"$prj\""
        parse_prj_config "$cfgfile" "$prj"
 
-       if [ -n "$cfg_name" ] && [ "$cfg_reply_to_all" == "1" ]; then
+       if [ -n "$pcfg_name" ] && [ "$pcfg_reply_to_all" == "1" ]; then
                # Strip own address
                to=$(strip_address "$to" "$cfg_ownmail")
        else
index 4bb0c091a4265ea27785bfa0238c845c76ae70a5..01acc9d104a72749a4d47c1fa89a471ec5cd8a84 100644 (file)
@@ -162,11 +162,11 @@ parse_config()
 # Similar to "parse_config", but parses a project configuration section. If the
 # project is found, the following variables are defined:
 #
-# cfg_name. cfg_description, cfg_path, cfg_configs, cfg_branch,
-# cfg_reply_to_all, # cfg_accept_notify, cfg_always_cc, cfg_unwanted_keywords,
-# and cfg_kmake_opts.
+# cfg_name. pcfg_description, pcfg_path, pcfg_configs, pcfg_branch,
+# pcfg_reply_to_all, pcfg_accept_notify, pcfg_always_cc,
+# pcfg_unwanted_keywords, and pcfg_kmake_opts.
 #
-# If the project is not found, this function only defined an empty "cfg_name"
+# If the project is not found, this function only defined an empty "pcfg_name"
 # variable.
 #
 # Usage: parse_prj_config <cfgfile> <prj>
@@ -175,19 +175,19 @@ parse_prj_config()
        local cfgfile="$1"; shift
        local prj="$1"; shift
 
-       cfg_name="$(ini_config_get "$cfgfile" "prj_$prj" "name")"
-       [ -n "$cfg_name" ] || return 0
+       pcfg_name="$(ini_config_get "$cfgfile" "prj_$prj" "name")"
+       [ -n "$pcfg_name" ] || return 0
 
-       ini_config_get_or_die cfg_description   "$cfgfile" "prj_$prj" "description"
-       ini_config_get_or_die cfg_path          "$cfgfile" "prj_$prj" "path"
-       ini_config_get_or_die cfg_configs       "$cfgfile" "prj_$prj" "configs"
-       ini_config_get_or_die cfg_branch        "$cfgfile" "prj_$prj" "branch"
-       ini_config_get_or_die cfg_reply_to_all  "$cfgfile" "prj_$prj" "reply_to_all"
-       ini_config_get_or_die cfg_accept_notify "$cfgfile" "prj_$prj" "accept_notify"
+       ini_config_get_or_die pcfg_description   "$cfgfile" "prj_$prj" "description"
+       ini_config_get_or_die pcfg_path          "$cfgfile" "prj_$prj" "path"
+       ini_config_get_or_die pcfg_configs       "$cfgfile" "prj_$prj" "configs"
+       ini_config_get_or_die pcfg_branch        "$cfgfile" "prj_$prj" "branch"
+       ini_config_get_or_die pcfg_reply_to_all  "$cfgfile" "prj_$prj" "reply_to_all"
+       ini_config_get_or_die pcfg_accept_notify "$cfgfile" "prj_$prj" "accept_notify"
 
-       cfg_always_cc="$(ini_config_get "$cfgfile" "prj_$prj" "always_cc")"
-       cfg_unwanted_keywords="$(ini_config_get "$cfgfile" ""prj_$prj"" "unwanted_keywords")"
-       cfg_kmake_opts="$(ini_config_get "$cfgfile" "prj_$prj" "kmake_opts")"
+       pcfg_always_cc="$(ini_config_get "$cfgfile" "prj_$prj" "always_cc")"
+       pcfg_unwanted_keywords="$(ini_config_get "$cfgfile" ""prj_$prj"" "unwanted_keywords")"
+       pcfg_kmake_opts="$(ini_config_get "$cfgfile" "prj_$prj" "kmake_opts")"
 }
 
 # Compose (but not send) e-mail reply. This function assumes that the following
index ee071f8433bd2724a6440b56e9324e6ad1be8d00..3abc96040d398bc62c9e9cf52f0a982e9ebe451b 100755 (executable)
@@ -194,9 +194,9 @@ $cfg_built_preamble
 
 $(fetch_header_per_patch "Subject" < "$mbox" | sort)
 
-Project: $cfg_name ($cfg_description)
+Project: $pcfg_name ($pcfg_description)
 
-Configurations: $cfg_configs
+Configurations: $pcfg_configs
 
 $(cat -- $tmpdir/test-patchset.log)
 EOF
@@ -314,14 +314,14 @@ fi
 parse_prj_config "$cfgfile" "$prj"
 
 # Check if we have this project in our config file
-if [ -z "$cfg_name" ]; then
+if [ -z "$pcfg_name" ]; then
        error_project_not_found
 fi
 
 # Merge the "To" and "Cc" addresses
 to="$(merge_addresses "$to" "$cc")"
 
-if [ "$cfg_reply_to_all" != "1" ]; then
+if [ "$pcfg_reply_to_all" != "1" ]; then
        to=
 else
        # Strip own address
@@ -329,19 +329,20 @@ else
 fi
 
 # Notify the sender that the patches have been accepted
-if [ "$cfg_accept_notify" = "1" ]; then
+if [ "$pcfg_accept_notify" = "1" ]; then
        verbose "Sending \"accepted\" e-mail"
        send_accepted_email
 fi
 
 # Test the path (or patch-set)
-verbose "Test configs \"$cfg_configs\" branch \"$cfg_branch\" of \"$cfg_path\""
-aiaiai-test-patchset $verbose $preserve $bisectability $sparse $smatch $cppcheck $coccinelle \
-       -i "$mbox" -j "$cfg_jobs" -c "$cfg_branch" -w "$tmpdir" \
+verbose "Test configs \"$pcfg_configs\" branch \"$pcfg_branch\" of \"$pcfg_path\""
+aiaiai-test-patchset $verbose $preserve \
+       $bisectability $sparse $smatch $cppcheck $coccinelle \
+       -i "$mbox" -j "$cfg_jobs" -c "$pcfg_branch" -w "$tmpdir" \
        ${confdir:+-C "$confdir"} \
-       ${cfg_unwanted_keywords:+-K "$cfg_unwanted_keywords"} -- \
-       ${cfg_kmake_opts:+-M "$cfg_kmake_opts"} \
-       "$cfg_path" "$cfg_configs" > "$tmpdir/test-patchset.log" ||
+       ${pcfg_unwanted_keywords:+-K "$pcfg_unwanted_keywords"} -- \
+       ${pcfg_kmake_opts:+-M "$pcfg_kmake_opts"} \
+       "$pcfg_path" "$pcfg_configs" > "$tmpdir/test-patchset.log" ||
 {
        verbose "aiaiai-test-patchset failed"
        error_test_patchset_failed