[PATCH 2/2] osbuilder: skip obvious tmp and backup files

martin.langhoff at gmail.com martin.langhoff at gmail.com
Tue Feb 22 17:26:18 EST 2011


From: Martin Langhoff <martin at laptop.org>

Makes life much easier when using a development copy
of OOB -- avoids running the temp files emacs creates.

Based on ye olde run-parts, plus a few obvious ones.
---
 osbuilder.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/osbuilder.py b/osbuilder.py
index fc5d577..bfcceec 100755
--- a/osbuilder.py
+++ b/osbuilder.py
@@ -138,10 +138,16 @@ class Stage(object):
                            % (self.osb.moddir, mod, self.name))
             partlist.extend(matches)
 
-        # sort them
+        # filter and sort them
         parts = {}
+        skipprefixes = re.compile('(#|\.)')
+        skipsuffixes = re.compile('(\.rpmsave|\.rpmorig|\.rpmnew|swp|~|#)$')
         for part in partlist:
             bname = os.path.basename(part)
+            if skipprefixes.match(bname):
+                continue
+            if skipsuffixes.search(bname):
+                continue
             mod = os.path.basename(os.path.dirname(part))
             parts[bname + "//" + mod] = os.path.join(mod, bname)
         items = parts.keys()
-- 
1.6.2.5




More information about the Devel mailing list