emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[ELPA-diffs] /srv/bzr/emacs/elpa r227: Add --prefix option to forward-di


From: Glenn Morris
Subject: [ELPA-diffs] /srv/bzr/emacs/elpa r227: Add --prefix option to forward-diffs.py
Date: Wed, 23 May 2012 16:48:03 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 227
committer: Glenn Morris <address@hidden>
branch nick: elpa
timestamp: Wed 2012-05-23 16:48:03 -0400
message:
  Add --prefix option to forward-diffs.py
modified:
  admin/forward-diffs.py
=== modified file 'admin/forward-diffs.py'
--- a/admin/forward-diffs.py    2012-05-23 20:26:36 +0000
+++ b/admin/forward-diffs.py    2012-05-23 20:48:03 +0000
@@ -160,7 +160,8 @@
 
 
 usage="""usage: %prog <-p /path/to/packages> <-m maintfile>
-   <-l logfile -s sender|--create> [-o overmaintfile] [--sendmail] [--debug]
+   <-l logfile -s sender|--create> [-o overmaintfile] [--prefix prefix]
+   [--sendmail] [--debug]
 Take an emacs-diffs mail on stdin, and forward it to the maintainer(s)."""
 
 parser = optparse.OptionParser()
@@ -183,6 +184,8 @@
 parser.add_option( "--no-update", dest="noupdate", default=False,
                    action="store_true",
                    help="do not update the maintfile")
+parser.add_option( "--prefix", dest="prefix", default="packages/",
+                   help="prefix to remove from modified file name [default: 
%default]")
 parser.add_option( "--sendmail", dest="sendmail", default=False,
                    action="store_true", help="use sendmail rather than smtp")
 parser.add_option( "--debug", dest="debug", default=False,
@@ -289,14 +292,17 @@
 
     if not start: continue
 
-    if re.match( ' *$', line ): break
-
-
-    reg = re.match( 'packages/([^ ]+)', line.strip() )
-    if not reg: break
-
-
-    pfile = reg.group(1)
+    ## An empty line or a line with non-empty first character.
+    if re.match( '( *$|[^ ])', line ): break
+
+
+    if opts.prefix:
+        reg = re.match( '%s([^ ]+)' % opts.prefix, line.strip() )
+        if not reg: continue
+        pfile = reg.group(1)
+    else:
+        pfile = line.strip()
+
 
     lfile.write('File: %s\n' % pfile)
 


reply via email to

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