commit-womb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-womb] gnumaint gnumaint


From: Jose E. Marchesi
Subject: [Commit-womb] gnumaint gnumaint
Date: Fri, 29 Dec 2006 02:49:29 +0000

CVSROOT:        /cvsroot/womb
Module name:    gnumaint
Changes by:     Jose E. Marchesi <jemarch>      06/12/29 02:49:29

Modified files:
        .              : gnumaint 

Log message:
        Updated `do_recemail_operation' in order to support many $pkgname:foo$
        marks on each received email.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnumaint/gnumaint?cvsroot=womb&r1=1.9&r2=1.10

Patches:
Index: gnumaint
===================================================================
RCS file: /cvsroot/womb/gnumaint/gnumaint,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- gnumaint    28 Dec 2006 20:02:19 -0000      1.9
+++ gnumaint    29 Dec 2006 02:49:29 -0000      1.10
@@ -335,50 +335,61 @@
            ;# Activity response email
            ;#
 
-           ;# Search for packages names on the control line
-           set pkg_name {}
-           set package_name_regexp ".*\\\$pkgname:(\[^$\]*)\\\$.*"
-           regexp $package_name_regexp $body match pkg_name
-           if {$pkg_name == ""} then {
-               ;# No package mark => discard this email
-           } else {
-
-               ;# Get the right package
-               foreach pkg $maintainersdb {
-
-                   if {$pkg_name == [lindex $pkg 0]} then {
-
-                       ;# Make sure the email sender is a maintainer
-                       ;# for this package
-                       foreach mnt [lindex $pkg 1] {
+            ;# Search for maintainer information (from the message email)
+            set maintainer_name {}
+            set maintainer_email {}
+            foreach mnt $maintainersdb {
 
                            set maintainer_name [lindex $mnt 0]
                            set maintainer_email [lindex $mnt 1]
-
                            if {[string match "*$maintainer_email*" $from]} 
then {
                                
-                               ;# Log the operation
-                               add_to_log \
-                                   "received activity control email reply from 
$maintainer_email for package $pkg_name" 
-
-                               ;# Annotate this reply into the activity file
-                               ;# activity_annotate $pkg_name $maintainer_name
+                    ;# Maintainer found
+                    break
                            }
+            }
+            if {$maintainer_email == ""} then {
 
+                ;# Cannot recognize maintainer: discard email
                            break
+
                        }
 
-                       break
+           ;# Search for package names on the control line
+           set pkgs {}
+           set package_name_regexp "\\\$pkgname:(\[^$\]*)\\\$"
+            set inline_pkgs [regexp -inline -all -- $package_name_regexp $body]
+            foreach inline_pkg $inline_pkgs {
+
+                if {![regexp "^\\\$pkgname:.*" $inline_pkg]} then {
+                    lappend pkgs $inline_pkg
                    }
                }
+
+           if {[llength $pkgs] == 0} then {
+               ;# No package marks => discard this email
+           } else {
+
+                ;# Log the operation
+                add_to_log \
+                    "received activity control email reply from 
$maintainer_name for packages $pkgs"
+
+                ;# Annotate this packages into the activity file
+                activity_annotate $pkgs $maintainer_name
            }
+
        }
        default {
-           ;# Unkown email type. Ignore it.
+           ;# Unknown email type. Ignore it.
        }
     }
 }
 
+proc activity_annotate {} {
+
+
+}
+
 proc do_sendemail_operation {opargs} {
 
     if {[llength $opargs] == 1} then {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]