debian/lib/python/debian_linux/patches.py:

Support shell style globs in remove action.

svn path=/dists/trunk/linux-2.6/; revision=12015
This commit is contained in:
Bastian Blank 2008-08-10 09:35:19 +00:00
parent ac5e820387
commit 33f0a2eb8a
1 changed files with 7 additions and 6 deletions

View File

@ -1,4 +1,4 @@
import os, shutil
import glob, os, shutil
class Operation(object):
def __init__(self, name, data):
@ -70,11 +70,12 @@ class SubOperationFilesRemove(SubOperation):
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"