From fb7c5ac9844d4a56b6b0fe6b512230456d622ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Tue, 18 Apr 2006 22:09:05 +0000 Subject: [PATCH] =?UTF-8?q?bo=C5=9F=20fonk'a=20babay,=20copy=20sorununu=20?= =?UTF-8?q?=C5=9Fimdilik=20workarounla.=20actionsAPI=20api=20bozmadan=20il?= =?UTF-8?q?k=20bo=C5=9F=20f=C4=B1rsatta=20g=C3=B6zden=20ge=C3=A7irilecek/r?= =?UTF-8?q?efactor=20edilecek...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/actionsapi/pisitools.py | 5 ----- pisi/actionsapi/shelltools.py | 7 ++++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/pisi/actionsapi/pisitools.py b/pisi/actionsapi/pisitools.py index b4e632b5..7352d616 100644 --- a/pisi/actionsapi/pisitools.py +++ b/pisi/actionsapi/pisitools.py @@ -55,11 +55,6 @@ def doexe(sourceFile, destinationDirectory): ''' example call: pisitools.doexe("kde-3.4.sh", "/etc/X11/Sessions")''' executable_insinto(join_path(get.installDIR(), destinationDirectory), sourceFile) -def dohard(sourceFile, destinationFile): - '''creates hard link between sourceFile and destinationFile''' - #FIXME: How can i use hard-links in Python? - ctx.ui.warning('*** Hard links not implemented yet') - def dohtml(*sourceFiles): '''inserts the files in the list of files into /usr/share/doc/PACKAGE/html''' diff --git a/pisi/actionsapi/shelltools.py b/pisi/actionsapi/shelltools.py index 2f5a8de3..8fd6a29c 100644 --- a/pisi/actionsapi/shelltools.py +++ b/pisi/actionsapi/shelltools.py @@ -122,6 +122,7 @@ def move(source, destination): else: error(_('ActionsAPI [move]: File %s doesn\'t exists.') % (filePath)) +# FIXME: instead of passing a sym parameter, split copy and copytree into 4 different function def copy(source, destination, sym = True): '''recursively copy a "source" file or directory to "destination"''' for filePath in glob.glob(source): @@ -138,10 +139,10 @@ def copy(source, destination, sym = True): os.remove(destination) os.symlink(os.readlink(filePath), destination) elif isLink(filePath) and not sym: - if isDirectory(os.readlink(filePath)): - copytree(os.readlink(filePath), destination) + if isDirectory(filePath): + copytree(filePath, destination) else: - shutil.copy(os.readlink(filePath), destination) + shutil.copy(filePath, destination) elif isDirectory(filePath): copytree(filePath, destination, sym) else: