insinto changes for glob compatibility

This commit is contained in:
S.Çağlar Onur
2005-08-14 17:11:38 +00:00
parent 2e9fe2e025
commit ce9074d8b8
+3
View File
@@ -190,8 +190,11 @@ def insinto(destinationDirectory, sourceFile, destinationFile = ''):
'''insert a sourceFile into destinationDirectory as a destinationFile with same uid/guid/permissions''' '''insert a sourceFile into destinationDirectory as a destinationFile with same uid/guid/permissions'''
makedirs(get.installDIR() + destinationDirectory) makedirs(get.installDIR() + destinationDirectory)
if not destinationFile:
for file in glob.glob(sourceFile): for file in glob.glob(sourceFile):
if can_access_file(file): if can_access_file(file):
shutil.copy(file, get.installDIR() + os.path.join(destinationDirectory, os.path.basename(file)))
else:
shutil.copy(sourceFile, get.installDIR() + os.path.join(destinationDirectory, destinationFile)) shutil.copy(sourceFile, get.installDIR() + os.path.join(destinationDirectory, destinationFile))
''' ************************************************************************** ''' ''' ************************************************************************** '''