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
+6 -3
View File
@@ -190,9 +190,12 @@ def insinto(destinationDirectory, sourceFile, destinationFile = ''):
'''insert a sourceFile into destinationDirectory as a destinationFile with same uid/guid/permissions'''
makedirs(get.installDIR() + destinationDirectory)
for file in glob.glob(sourceFile):
if can_access_file(file):
shutil.copy(sourceFile, get.installDIR() + os.path.join(destinationDirectory, destinationFile))
if not destinationFile:
for file in glob.glob(sourceFile):
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))
''' ************************************************************************** '''