X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2Fcopytree.py;h=68aa223e86aaa27da86789704835c77d65e43292;hb=3fec1cb20c598e4d47ba1ddbcad74d9a2d7271e5;hp=4e568dea3ff8c50fe1c645dc0506257f8f7a1b02;hpb=1f7a65ac5febb0f189a13c2369478085ebe9422d;p=bertos.git diff --git a/wizard/copytree.py b/wizard/copytree.py index 4e568dea..68aa223e 100644 --- a/wizard/copytree.py +++ b/wizard/copytree.py @@ -4,7 +4,7 @@ # Copyright 2009 Develer S.r.l. (http://www.develer.com/) # All rights reserved. # -# $Id:$ +# $Id$ # # Author: Lorenzo Berni # @@ -13,6 +13,8 @@ import os import fnmatch from shutil import * +del copytree + def copytree(src, dst, symlinks=False, ignore_list=[]): """ Reimplementation of the shutil.copytree function that use ignore_list. @@ -27,7 +29,7 @@ def copytree(src, dst, symlinks=False, ignore_list=[]): try: ignored = False for ignore in ignore_list: - if fnmatch.fnmatch(srcname, ignore): + if fnmatch.fnmatch(name, ignore): ignored = True break if ignored: @@ -36,7 +38,7 @@ def copytree(src, dst, symlinks=False, ignore_list=[]): linkto = os.readlink(srcname) os.symlink(linkto, dstname) elif os.path.isdir(srcname): - copytree(srcname, dstname, symlinks) + copytree(srcname, dstname, symlinks, ignore_list) else: copy2(srcname, dstname) # XXX What about devices, sockets etc.?