script: allow JIRA BugId check in the merge_pre_check.pl script
authorJianxiong Pan <jianxiong.pan@amlogic.com>
Wed, 10 Oct 2018 06:40:28 +0000 (14:40 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Mon, 15 Oct 2018 06:24:17 +0000 (23:24 -0700)
PD#174488: add JIRA BugId check in the merge_pre_check.pl script

Change-Id: I32f2fc123041e6c40ce2a5c4208734e11b307fd5
Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com>
scripts/amlogic/merge_pre_check.pl

index 238aac0..e04be96 100755 (executable)
@@ -118,11 +118,12 @@ sub check_msg_49
 
        if( $lnum == 7 )
        {
-               if( $line !~ /^(\s){4}PD\#(\d)+/ )
+               if( $line !~ /^(\s){4}PD\#(\d)+/ &&
+                       $line !~ /^(\s){4}PD\#SWPL-(\d)+/ )
                {
                        $err_cnt += 1;
                        $line =~ s/^(\s){4}//;
-                       $err_msg .= "    $err_cnt: <PD#xxxx: detailed description>, but <$line>\n";
+                       $err_msg .= "    $err_cnt: <PD#xxxx/PD#SWPL-XXXX: detailed description>, but <$line>\n";
                }
        }
 }
@@ -134,11 +135,12 @@ sub check_msg_314
 
        if( $lnum == 5 )
        {
-               if ($line !~ /^(\s){4}PD\#(\d)+:\s([\w]+:\s){1,2}[\w]+.*[\S]+$/)
+               if ($line !~ /^(\s){4}PD\#(\d)+:\s([\w]+:\s){1,2}[\w]+.*[\S]+$/
+       && $line !~ /^(\s){4}PD\#SWPL-(\d)+:\s([\w]+:\s){1,2}[\w]+.*[\S]+$/)
                {
                        $err_cnt += 1;
                        $line =~ s/^(\s){4}//;
-                       $err_msg .= "    $err_cnt: <PD#XXXX: module_id: commit message>, but <$line>\n";
+                       $err_msg .= "    $err_cnt: <PD#XXXX/PD#SWPL-XXXX: module_id: commit message>, but <$line>\n";
                }
                elsif ( $line =~ /(kernel)/i)
                {