]> code.delx.au - gnu-emacs-elpa/commitdiff
re.match always searches from the start, so no need for ^.
authorGlenn Morris <rgm@gnu.org>
Wed, 23 May 2012 06:40:00 +0000 (23:40 -0700)
committerGlenn Morris <rgm@gnu.org>
Wed, 23 May 2012 06:40:00 +0000 (23:40 -0700)
Tweak missing packagedir error message.

admin/forward-diffs.py

index 9de81e23135477dcbfadf9f6a0b994d3347abecc..56116fde50b76194123879cb8cda76d91f262904 100755 (executable)
@@ -90,7 +90,7 @@ if not opts.sender:
 
 
 if not os.path.isdir(opts.packagedir):
-    sys.stderr.write('Error reading packagedir\n')
+    sys.stderr.write('No such directory: %s\n' % opts.packagedir)
     sys.exit(1)
 
 
@@ -111,7 +111,7 @@ except Exception as err:
 maints = {}
 
 for line in mfile:
-    if re.match( '^#|^ *$', line ): continue
+    if re.match( '#| *$', line ): continue
     (pack, maint) = line.split()
     maints[pack] = maint.split(',')
 
@@ -126,7 +126,7 @@ if opts.overmaintfile:
         sys.exit(1)
 
     for line in ofile:
-        if re.match( '^#|^ *$', line ): continue
+        if re.match( '#| *$', line ): continue
         (pack, maint) = line.split()
         maints[pack] = maint.split(',')
 
@@ -159,16 +159,16 @@ maints_seen = []
 
 for line in text.splitlines():
 
-    if re.match( '^modified:$', line ):
+    if re.match( 'modified:$', line ):
         start = True
         continue
 
     if not start: continue
 
-    if re.match( '^ *$', line ): break
+    if re.match( ' *$', line ): break
 
 
-    reg = re.match( '^packages/([^/]+)', line.strip() )
+    reg = re.match( 'packages/([^/]+)', line.strip() )
     if not reg: break