[prev in list] [next in list] [prev in thread] [next in thread] 

List:       olpc-devel
Subject:    [PATCH 2/2] osbuilder: skip obvious tmp and backup files
From:       martin.langhoff () gmail ! com
Date:       2011-02-22 22:26:18
Message-ID: 1298413578-15748-3-git-send-email-martin.langhoff () gmail ! com
[Download RAW message or body]

From: Martin Langhoff <martin@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

_______________________________________________
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic