From ce9074d8b8058563370d13517ea03ee7f670acf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Sun, 14 Aug 2005 17:11:38 +0000 Subject: [PATCH] insinto changes for glob compatibility --- pisi/actionsapi/pisitools.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pisi/actionsapi/pisitools.py b/pisi/actionsapi/pisitools.py index 43fd378a..d4b35bf4 100644 --- a/pisi/actionsapi/pisitools.py +++ b/pisi/actionsapi/pisitools.py @@ -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)) ''' ************************************************************************** '''