UpdateChangeLog: tweak new/changed coded
authorZac Medico <zmedico@gentoo.org>
Fri, 21 Oct 2011 04:53:14 +0000 (21:53 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 21 Oct 2011 04:53:14 +0000 (21:53 -0700)
pym/repoman/utilities.py

index 0ecc92cc7617f123ccb1754c4524f170ffb4effd..6b4bd5098059a3d4cd27ac4f2a78d6b0af47badb 100644 (file)
@@ -629,7 +629,7 @@ def UpdateChangeLog(pkgdir, user, msg, skel_path, category, package,
 
        # check modified files and the ChangeLog for copyright updates
        # patches and diffs (identified by .patch and .diff) are excluded
-       for fn in new + changed:
+       for fn in chain(new, changed):
                if fn.endswith('.diff') or fn.endswith('.patch'):
                        continue
                update_copyright(os.path.join(pkgdir, fn), year, pretend)
@@ -711,14 +711,13 @@ def UpdateChangeLog(pkgdir, user, msg, skel_path, category, package,
                if not (display_new or display_removed or display_changed):
                        # If there's nothing else to display, show one of the
                        # trivial files.
-                       if 'ChangeLog' in new:
-                               display_new = ['+ChangeLog']
-                       elif 'ChangeLog' in changed:
-                               display_changed = ['ChangeLog']
-                       elif 'Manifest' in new:
-                               display_new = ['+Manifest']
-                       elif 'Manifest' in changed:
-                               display_changed = ['Manifest']
+                       for fn in trivial_files:
+                               if fn in new:
+                                       display_new = ['+' + fn]
+                                       break
+                               elif fn in changed:
+                                       display_changed = [fn]
+                                       break
 
                mesg = '%s; %s %s:' % (date, user, ', '.join(chain(
                        display_new, display_removed, display_changed)))