[kernel] r12015 - dists/trunk/linux-2.6/debian/lib/python/debian_linux

Bastian Blank waldi at alioth.debian.org
Sun Aug 10 09:35:19 UTC 2008


Author: waldi
Date: Sun Aug 10 09:35:19 2008
New Revision: 12015

Log:
debian/lib/python/debian_linux/patches.py:
Support shell style globs in remove action.


Modified:
   dists/trunk/linux-2.6/debian/lib/python/debian_linux/patches.py

Modified: dists/trunk/linux-2.6/debian/lib/python/debian_linux/patches.py
==============================================================================
--- dists/trunk/linux-2.6/debian/lib/python/debian_linux/patches.py	(original)
+++ dists/trunk/linux-2.6/debian/lib/python/debian_linux/patches.py	Sun Aug 10 09:35:19 2008
@@ -1,4 +1,4 @@
-import os, shutil
+import glob, os, shutil
 
 class Operation(object):
     def __init__(self, name, data):
@@ -70,11 +70,12 @@
     operation = "remove"
 
     def do(self, dir):
-        dir = os.path.join(dir, self.name)
-        if os.path.isdir(dir):
-            shutil.rmtree(dir)
-        else:
-            os.unlink(dir)
+        name = os.path.join(dir, self.name)
+        for n in glob.iglob(name):
+            if os.path.isdir(n):
+                shutil.rmtree(n)
+            else:
+                os.unlink(n)
 
 class SubOperationFilesUnifdef(SubOperation):
     operation = "unifdef"



More information about the Kernel-svn-changes mailing list